added data table

This commit is contained in:
2025-07-15 14:37:09 -04:00
parent 3a2b20e468
commit 049def6886
8 changed files with 299 additions and 35 deletions

View File

@@ -0,0 +1,65 @@
'use client'
import { ColumnDef } from '@tanstack/react-table'
import { DataTable } from './DataTable'
interface LocationRow {
id: string
name: string
address: string
city: string
state: string
postalCode: string
country: string
phone?: string | null
email?: string | null
}
interface Props {
eventLocations: LocationRow[]
}
const columns: ColumnDef<LocationRow>[] = [
{
accessorKey: 'name',
header: 'Name'
},
{
accessorKey: 'address',
header: 'Address'
},
{
accessorKey: 'city',
header: 'City'
},
{
accessorKey: 'state',
header: 'State'
},
{
accessorKey: 'postalCode',
header: 'Postal Code'
},
{
accessorKey: 'country',
header: 'Country'
},
{
accessorKey: 'phone',
header: 'Phone',
cell: ({ row }) => row.original.phone || '—'
},
{
accessorKey: 'email',
header: 'Email',
cell: ({ row }) => row.original.email || '—'
}
]
export default function LocationsTable({ eventLocations }: Props) {
return (
<div className="mt-4">
<DataTable columns={columns} data={eventLocations} />
</div>
)
}