/* eslint-disable react/no-array-index-key,react/no-danger */ import React from 'react' import { LmTableProps } from './tableTypes' import Box from '@mui/material/Box' import { useTheme } from '@mui/material/styles' import clsx from 'clsx' type TableRowProps = { content: string[]; index: number } function TableRow({ content, index }: TableRowProps): JSX.Element { return ( {content.map((column: string, iterator: number) => ( ))} ) } export default function LmTable({ content }: LmTableProps): JSX.Element { const theme = useTheme() const tableBody = (content.body && content.body.tbody) || [] const tableHead = (content.body && content.body.thead) || [] return (
td': { borderBottom: `1px solid ${theme.palette.divider}`, '&:not(:first-child)': { borderBottom: `1px solid ${theme.palette.divider}`, boxShadow: '-1px 3px 7px 0 rgba(240, 240, 240, .7)' } } } } }} className={clsx('lm-table', content.class_names?.values, { [`lm-table__${content.variant}`]: !!content.variant })} > {!content.disable_table_head && ( {tableHead.map((c, i) => ( {c} ))} )} {tableBody.map((row, i) => ( ))}
) }