"use client" import * as React from "react" import { InlineInputEdit, InlineSelectEdit, } from "@exxatdesignux/ui/components/ui/inline-edit" import { InlineInputCell, InlineSelectCell, } from "@exxatdesignux/ui/components/data-views/table-cells" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table" const STATUS_OPTIONS = [ { value: "draft", label: "Draft" }, { value: "review", label: "In review" }, { value: "published", label: "Published" }, ] as const export function InlineEditPreview() { const [title, setTitle] = React.useState("Cardiopulmonary assessment") const [status, setStatus] = React.useState("review") return (
Title Status

Enter saves a text draft. Escape cancels. Select changes require Save.

) } interface EditableRow { id: string activity: string status: string } const INITIAL_ROWS: EditableRow[] = [ { id: "ACT-1042", activity: "Clinical skills check", status: "draft" }, { id: "ACT-1043", activity: "Site readiness review", status: "review" }, ] export function TableInlineEditPreview() { const [rows, setRows] = React.useState(INITIAL_ROWS) function updateRow(id: string, patch: Partial) { setRows((current) => current.map((row) => (row.id === id ? { ...row, ...patch } : row)) ) } return ( ID Activity Status {rows.map((row) => ( {row.id} updateRow(row.id, { activity })} /> updateRow(row.id, { status })} /> ))}
) }