import { ColumnDef } from "@tanstack/react-table"; import { format } from "date-fns"; // This type is used to define the shape of our data. // You can use a Zod schema here if you want. export type Adjustmnets = { siloAdjust_id: string; currentStockLevel: string; newLevel: number; dateAdjusted: string; lastDateAdjusted: string; comment: string; commentAddedBy: string; commentDate: string; add_user: string; }; export const notifyColumns: ColumnDef[] = [ { accessorKey: "name", header: () =>
Name
, }, { accessorKey: "description", header: "Description", cell: ({ row }) => { return (

{row.getValue("description")}

); }, }, { accessorKey: "checkInterval", header: "Check Interval", }, { accessorKey: "timeType", header: "Time tpye", }, { accessorKey: "emails", header: "Emails", }, { accessorKey: "active", header: "Active", }, { accessorKey: "lastRan", header: "Last Ran", cell: ({ row }) => { if (row.getValue("lastRan")) { const correctDate = format( row.getValue("lastRan"), "M/d/yyyy hh:mm" ); return (
{correctDate}
); } }, }, ];