Modals and API calls working for admin tab
This commit is contained in:
46
src/components/table/TableBody.tsx
Normal file
46
src/components/table/TableBody.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
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",
|
||||
{
|
||||
"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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user