import parse from 'html-react-parser';
import React, { FC } from 'react';
import Styles from './Table.module.css';
export type TTableData = {
content: string[][];
withHeadings: boolean;
};
export const Table: FC = ({ withHeadings, content }) => {
const _content = content.slice();
const heading = withHeadings ? _content.splice(0, 1) : [];
return (
{withHeadings && (
{heading[0]?.map((text, index) => (
|
{parse(text)}
|
))}
)}
{_content.map((row, index) => (
{row.map((text, index) => (
|
{parse(text)}
|
))}
))}
);
};