"use client"; import { useState } from "react"; import { DataTable } from "@/components/common/data-table"; import { FileUpload } from "@/components/common/file-upload"; import { StatusBadge } from "@/components/common/status-badge"; import { ConfirmDialog } from "@/components/common/confirm-dialog"; import { Pagination } from "@/components/common/pagination"; import { Button } from "@/components/ui/button"; import { ColumnDef } from "@tanstack/react-table"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; // Mock Data for Table interface Payment { id: string; amount: number; status: string; email: string; } const columns: ColumnDef[] = [ { accessorKey: "status", header: "Status", cell: ({ row }) => , }, { accessorKey: "email", header: "Email", }, { accessorKey: "amount", header: "Amount", cell: ({ row }) => { const amount = parseFloat(row.getValue("amount")); const formatted = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }).format(amount); return
{formatted}
; }, }, ]; const data: Payment[] = [ { id: "1", amount: 100, status: "PENDING", email: "m@example.com" }, { id: "2", amount: 200, status: "APPROVED", email: "test@example.com" }, { id: "3", amount: 300, status: "REJECTED", email: "fail@example.com" }, { id: "4", amount: 400, status: "IN_REVIEW", email: "review@example.com" }, { id: "5", amount: 500, status: "DRAFT", email: "draft@example.com" }, ]; export default function DemoPage() { const [files, setFiles] = useState([]); const [dialogOpen, setDialogOpen] = useState(false); const [page, setPage] = useState(1); return (

Common Components Demo

{/* Status Badges */} Status Badges {/* File Upload */} File Upload setFiles(files)} maxFiles={3} />

Selected Files:

    {files.map((f, i) => (
  • {f.name} ({(f.size / 1024).toFixed(2)} KB)
  • ))}
{/* Data Table */} Data Table {/* Pagination */} Pagination {/* Note: In a real app, clicking pagination would update 'page' via URL or state */} {/* Confirm Dialog */} Confirmation Dialog { alert("Confirmed!"); setDialogOpen(false); }} />
); }