47 lines
882 B
TypeScript
47 lines
882 B
TypeScript
import clsx from "clsx";
|
|
|
|
|
|
export default function TableBody({
|
|
bodyElements
|
|
}:{
|
|
bodyElements: React.ReactNode[][];
|
|
}){
|
|
return (
|
|
<tbody>
|
|
{
|
|
bodyElements.map((row, rowIndex) => (
|
|
<tr
|
|
key={rowIndex}
|
|
>
|
|
{
|
|
row.map((element, elementIndex) => (
|
|
<td
|
|
key={elementIndex}
|
|
className={clsx(
|
|
{
|
|
"w-0": elementIndex === 0 || elementIndex === row.length - 1
|
|
}
|
|
)}
|
|
>
|
|
<div
|
|
className={clsx(
|
|
"bg-neutral-200 dark:bg-neutral-700 h-14",
|
|
{
|
|
"py-4 my-2": elementIndex < row.length - 1,
|
|
"rounded-l pl-2": elementIndex === 0,
|
|
"rounded-r pr-2": elementIndex === row.length - 1
|
|
}
|
|
)}
|
|
>
|
|
{element}
|
|
</div>
|
|
</td>
|
|
))
|
|
}
|
|
</tr>
|
|
))
|
|
}
|
|
</tbody>
|
|
);
|
|
}
|