// src/app/(dashboard)/billing/page.tsx 'use client'; import { useState } from 'react'; import { Pencil } from 'lucide-react'; import { Button } from '@/components/ui/common/Button'; import { Badge } from '@/components/ui/common/Badge'; import { Table } from '@/components/ui/common/Table'; import { SearchBar } from '@/components/ui/common/SearchBar'; import { useAuth } from '@/lib/hooks/useAuth'; import { hasPermission } from '@/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-sky-900/30 text-sky-300 border-sky-700/60', yellow: 'bg-amber-900/30 text-amber-300 border-amber-700/60', green: 'bg-emerald-900/30 text-emerald-300 border-emerald-700/60', red: 'bg-red-950/30 text-red-300 border-red-700/60', }; 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}