Added CompactTable and ActionIcons UI components

This commit is contained in:
Paweł Malak
2022-03-25 11:04:16 +01:00
parent 9ab6c65d85
commit bd96f6ca50
10 changed files with 106 additions and 67 deletions

View File

@@ -0,0 +1,27 @@
import { ReactNode } from 'react';
import classes from './CompactTable.module.css';
interface Props {
headers: string[];
children?: ReactNode;
}
export const CompactTable = ({ headers, children }: Props): JSX.Element => {
return (
<div
className={classes.CompactTable}
style={{ gridTemplateColumns: `repeat(${headers.length}, 1fr)` }}
>
{headers.map((h, idx) => (
<span key={idx}>{h}</span>
))}
<div
className={classes.Separator}
style={{ gridColumn: `1 / ${headers.length + 1}` }}
></div>
{children}
</div>
);
};