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 ( + + + + + {showClientColumn && ( + + )} + + + + + + {rows.map((row) => ( + + + {showClientColumn && ( + + )} + + + + ))} + +
+ Document Name + + Client + + Status + + Date Sent +
{row.name} + {row.clientName ?? "—"} + + + + {row.sentAt + ? row.sentAt.toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + }) + : "—"} +
+ ); +} diff --git a/teressa-copeland-homes/src/app/portal/_components/StatusBadge.tsx b/teressa-copeland-homes/src/app/portal/_components/StatusBadge.tsx new file mode 100644 index 0000000..b733d8d --- /dev/null +++ b/teressa-copeland-homes/src/app/portal/_components/StatusBadge.tsx @@ -0,0 +1,18 @@ +type DocumentStatus = "Draft" | "Sent" | "Viewed" | "Signed"; + +const STATUS_STYLES: Record = { + Draft: "bg-gray-100 text-gray-600", + Sent: "bg-blue-100 text-blue-700", + Viewed: "bg-amber-100 text-amber-700", + Signed: "bg-green-100 text-green-700", +}; + +export function StatusBadge({ status }: { status: DocumentStatus }) { + return ( + + {status} + + ); +}