Download web/src/apps/AppGrid.tsx from fsanyoto/loopable: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/apps/AppGrid.tsx
- Command line
-
hf download hf://spaces/fsanyoto/loopable/web/src/apps/AppGrid.tsx
-
curl -L -o AppGrid.tsx https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/apps/AppGrid.tsx
1.02 kB
| 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>; | |
| } | |