-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcolumns.ts
46 lines (45 loc) · 861 Bytes
/
columns.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { renderComponent } from '$lib/components/ui/data-table';
import type { Person } from '$lib/types/person';
import type { ColumnDef } from '@tanstack/table-core';
import DataTableActions from './data-table-actions.svelte';
export const columns: ColumnDef<Person>[] = [
{
accessorKey: 'type',
header: 'Type'
},
{
accessorKey: 'fname',
header: 'First name'
},
{
accessorKey: 'lname',
header: 'Last name'
},
{
accessorKey: 'identifier',
header: 'Identifier'
},
{
accessorKey: 'department',
header: 'Department'
},
{
accessorKey: 'building',
header: 'Building'
},
{
accessorKey: 'state',
header: 'State'
},
{
id: 'actions',
header: 'Toggle State',
cell: ({ row }) => {
return renderComponent(DataTableActions, {
id: row.original.id,
type: row.original.type
});
},
enableSorting: false
}
];