From 6252979d28417ad0c134787af65dafaf3d95eeb9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 21 Mar 2024 16:46:02 -0400 Subject: [PATCH] refactor: update columns --- app/routes/file-manager/columns.tsx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/app/routes/file-manager/columns.tsx b/app/routes/file-manager/columns.tsx index b4a1f2b..4812ccb 100644 --- a/app/routes/file-manager/columns.tsx +++ b/app/routes/file-manager/columns.tsx @@ -4,15 +4,8 @@ import { FileIcon, MoreIcon } from "~/components/icons"; import { Checkbox } from "~/components/ui/checkbox"; import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "~/components/ui/dropdown-menu"; import { cn } from "~/utils"; - -// This type is used to define the shape of our data. -// You can use a Zod schema here if you want. -export type File = { - name: string; - cid: string; - size: string; - createdOn: string; -}; +import {FileItem} from "~/data/file-provider.js"; +import {format} from "date-fns/fp"; declare module '@tanstack/table-core' { interface TableMeta { @@ -20,13 +13,13 @@ declare module '@tanstack/table-core' { } } -export const columns: ColumnDef[] = [ +export const columns: ColumnDef[] = [ { id: "select", size: 20, header: ({ table }) => ( [] = [ header: "Size", }, { - accessorKey: "createdOn", + accessorKey: "pinnedOn", size: 200, - header: "Created On", + header: "Pinned On", cell: ({ row }) => (
- {row.getValue("createdOn")} + {format(row.getValue("pinned")) as unknown as string} [] = [
) } -]; \ No newline at end of file +];