import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { DataTable } from 'mantine-datatable';
dayjs.extend(relativeTime);
export default function DefaultColumnRenderExample() {
{ bookTitle: 'The Lord of the Rings', published: new Date(1954, 6, 29) },
{ accessor: 'bookTitle', width: '100%' },
{ accessor: 'published', textAlignment: 'right', ellipsis: true },
defaultColumnRender={(row, _, accessor) => {
const data = row[accessor as keyof typeof row];
return typeof data === 'string' ? data : dayjs(data).fromNow();