import { Table, TableProps } from '@mantine/core'; import { HtmlText } from '@/components/HtmlText'; import { TableInlineCode } from '@/components/TableInlineCode'; import type { StylesApiData } from './StylesApiTable'; interface VariablesTableProps extends Omit { data: StylesApiData; fixedLayout?: boolean; } export function VariablesTable({ data, fixedLayout = true, ...others }: VariablesTableProps) { const rows = Object.keys(data.vars).reduce((acc, selector) => { Object.keys(data.vars[selector]).forEach((variable, index) => { acc.push( {index === 0 && ( {selector} )} {variable} {data.vars[selector][variable]} ); }); return acc; }, []); return ( Selector Variable Description {rows}
); }