import { Table, TableBody, TableCell, TableHead, TableRow } from '@rocket.chat/fuselage'; import type * as MessageParser from '@rocket.chat/message-parser'; import InlineElements from '../elements/InlineElements'; export type TableBlockProps = { header: MessageParser.TableCell[]; rows: MessageParser.TableRow[]; }; // Explicit mapping (not an object lookup) so a crafted AST align like `__proto__` // or `toString` can never resolve to an inherited value. const toAlign = (align: MessageParser.TableCell['align']): 'start' | 'center' | 'end' | undefined => { switch (align) { case 'left': return 'start'; case 'center': return 'center'; case 'right': return 'end'; default: return undefined; } }; const TableBlock = ({ header, rows }: TableBlockProps) => (