1
0
Fork 0

refactor(infra.mareshq.com): put tables into component and add horizontal overflow

This commit is contained in:
Vojtěch Mareš 2022-08-22 09:43:01 +02:00
parent f1d73a22a2
commit fa96a47bdf
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
2 changed files with 82 additions and 67 deletions

View file

@ -0,0 +1,23 @@
import { ReactNode, FunctionComponent } from 'react';
type Props = {
columnNames: string[];
children?: ReactNode;
};
const Table = ({ columnNames, children }: Props) => (
<div className="overflow-x-auto">
<table className="table-fixed min-w-full">
<thead className="text-left">
<tr>
{columnNames.map((cn) => (
<th className="py-1 px-2">{cn}</th>
))}
</tr>
</thead>
{children}
</table>
</div>
);
export default Table;