import type { Column } from '@/components/shared/data-table'
import type { Account } from '@/types/account'
import { Badge } from '@/components/ui/badge'

export const accountColumns: Column<Account>[] = [
  {
    key: 'name',
    header: 'Name',
    sortable: true,
    render: (row) => <span className="font-medium">{row.name}</span>,
  },
  {
    key: 'email',
    header: 'Email',
    sortable: true,
    render: (row) => row.email ?? <span className="text-muted-foreground">-</span>,
  },
  {
    key: 'phone',
    header: 'Phone',
    render: (row) => row.phone ?? <span className="text-muted-foreground">-</span>,
  },
  {
    key: 'account_number',
    header: 'Account #',
    sortable: true,
    render: (row) => row.accountNumber ?? <span className="text-muted-foreground">-</span>,
  },
  {
    key: 'billingMode',
    header: 'Billing',
    render: (row) => (
      <Badge variant="secondary">{row.billingMode}</Badge>
    ),
  },
  {
    key: 'created_at',
    header: 'Created',
    sortable: true,
    render: (row) => new Date(row.createdAt).toLocaleDateString(),
  },
]
