import { ExpandListButton } from "@/src/features/dashboard/components/cards/ChevronButton"; import { useState, type ReactNode } from "react"; import { NoDataOrLoading } from "@/src/components/NoDataOrLoading"; type TableHeaders = ReactNode[]; type TableRows = ReactNode[][]; type DashboardTableProps = { headers: TableHeaders; rows: TableRows; children?: ReactNode; collapse?: { collapsed: number; expanded: number; }; noDataProps?: { description: string; href: string; }; isLoading: boolean; }; export const DashboardTable = ({ headers, rows, children, collapse, noDataProps, isLoading, }: DashboardTableProps) => { const [isExpanded, setExpanded] = useState(false); return ( <> {children} {rows.length > 0 ? (
| {header} | ))}
|---|
| {cell} | ))}