diff --git a/teressa-copeland-homes/src/app/portal/_components/DocumentsTable.tsx b/teressa-copeland-homes/src/app/portal/_components/DocumentsTable.tsx new file mode 100644 index 0000000..3101051 --- /dev/null +++ b/teressa-copeland-homes/src/app/portal/_components/DocumentsTable.tsx @@ -0,0 +1,61 @@ +import { StatusBadge } from "./StatusBadge"; + +type DocumentRow = { + id: string; + name: string; + clientName: string | null; + status: "Draft" | "Sent" | "Viewed" | "Signed"; + sentAt: Date | null; + clientId: string; +}; + +type Props = { rows: DocumentRow[]; showClientColumn?: boolean }; + +export function DocumentsTable({ rows, showClientColumn = true }: Props) { + return ( +
| + Document Name + | + {showClientColumn && ( ++ Client + | + )} ++ Status + | ++ Date Sent + | +
|---|---|---|---|
| {row.name} | + {showClientColumn && ( ++ {row.clientName ?? "—"} + | + )} +
+ |
+ + {row.sentAt + ? row.sentAt.toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + }) + : "—"} + | +