Files
stats/apps/web/src/components/projects/table.tsx
Carl-Gerhard Lindesvärd 2f3c5ddf76 refactor packages
2024-02-19 10:55:15 +01:00

29 lines
679 B
TypeScript

import { formatDate } from '@/utils/date';
import type { ColumnDef } from '@tanstack/react-table';
import { IServiceProject } from '@mixan/db';
import type { Project as IProject } from '@mixan/db';
import { ProjectActions } from './ProjectActions';
export type Project = IProject;
export const columns: ColumnDef<Project>[] = [
{
accessorKey: 'name',
header: 'Name',
},
{
accessorKey: 'createdAt',
header: 'Created at',
cell({ row }) {
const date = row.original.createdAt;
return <div>{formatDate(date)}</div>;
},
},
{
id: 'actions',
header: 'Actions',
cell: ({ row }) => <ProjectActions {...row.original} />,
},
];