Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 1,018 Bytes
8133df9 8729c1d 8133df9 8729c1d 8133df9 8729c1d 8133df9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import type { ReactNode } from "react";
import { AppTableGrid, OverlayProvider } from "../customer-grid/seam";
import type { AppTableHost, Row } from "../customer-grid/seam";
import "../styles/sdlc82/app-grid.css";
interface AppGridProps {
table: string | null | undefined;
onOpenRow: (row: Row) => void;
empty?: ReactNode;
}
/** One App table through the C2 seam. The grid draws History in its toolbar slot. */
function HostedTable({ table, onOpenRecord }: { table: string; onOpenRecord?: AppTableHost["data"]["onOpenRecord"] }) {
return <AppTableGrid data={{ database: table, onOpenRecord }} />;
}
export function AppGrid({ table, onOpenRow, empty = "No records yet." }: AppGridProps) {
return <div className="AppGrid" data-proof="app-grid">
<OverlayProvider>
{table ? <HostedTable key={table} table={table}
onOpenRecord={(_pid, _table, row) => { if (row) onOpenRow(row); }} />
: <div className="AppGrid-message" role="status">{empty}</div>}
</OverlayProvider>
</div>;
}
|