// src/app/(dashboard)/billing/page.tsx 'use client'; import { useState } from 'react'; import { Pencil } from 'lucide-react'; import { Button } from '@/components/ui/shared/Button'; import { Badge } from '@/components/ui/shared/Badge'; import { Card } from '@/components/ui/shared/Card'; import { Table } from '@/components/ui/shared/Table'; import { SearchBar } from '@/components/ui/shared/SearchBar'; import { useAuth } from '@/lib/hooks/useAuth'; import { hasPermission } from '@/components/shared/permissions'; // Mock data matching your design const invoices = [ { id: '#123456', patient: 'Ali Rahmani', date: '24/9/2026', service: 'Hygiene', amount: 300, paid: 0, status: 'unpaid' }, { id: '#123457', patient: 'Neda Akbari', date: '01/10/2026', service: 'Filling', amount: 700, paid: 400, status: 'overdue' }, { id: '#123458', patient: 'Nima Haghi', date: '09/12/2026', service: 'Extraction', amount: 450, paid: 450, status: 'paid' }, ]; const statusColors = { paid: 'success', unpaid: 'warning', overdue: 'danger', } as const; type StatCardColor = 'blue' | 'yellow' | 'green' | 'red'; interface StatCardProps { title: string; count: number; amount: number; color: StatCardColor; } export default function BillingPage() { const { currentOrganization } = useAuth(); const [search, setSearch] = useState(''); const [statusFilter, setStatusFilter] = useState('all'); const canEditBilling = hasPermission(currentOrganization, 'TAB_BILLING_EDIT'); const stats = { total: { count: 235, amount: 80900 }, unpaid: { count: 30, amount: 2800 }, paid: { count: 190, amount: 80900 }, overdue: { count: 235, amount: 80900 }, }; return (
{/* Header */}

Billing

{/* Stats Cards - Matching your design */}
{/* Filters */} {['all', 'paid', 'unpaid', 'overdue'].map((status) => ( ))} )} /> {/* Invoices Table - Matching your design */} } body={ <> {invoices.map((invoice) => ( ))} } footer={( <>
Page 1 of 10
)} /> ); } function StatCard({ title, count, amount, color }: StatCardProps) { const colors: Record = { blue: '!bg-purpose-visit-bg !text-purpose-visit-fg !border-purpose-visit-border', yellow: '!bg-badge-warning-bg !text-badge-warning-fg !border-badge-warning-border', green: '!bg-badge-success-bg !text-badge-success-fg !border-badge-success-border', red: '!bg-badge-danger-bg !text-badge-danger-fg !border-badge-danger-border', }; return (

{title}

{count}

${amount.toLocaleString()}

); }
Invoice ID Patient name Date Service Total amount Paid Status Action
{invoice.id} {invoice.patient} {invoice.date} {invoice.service} ${invoice.amount} ${invoice.paid} {invoice.status}