From 4cadd0072d50d19bf6857a4f9a37f5179ff74d5c Mon Sep 17 00:00:00 2001 From: Juan Di Toro Date: Wed, 27 Mar 2024 07:34:52 +0100 Subject: [PATCH] fix: filesize lib was buggy. removed selection options as we dont use thos --- app/components/lib/filesize.ts | 2 +- app/routes/file-manager/columns.tsx | 46 ++++++++++++++--------------- app/routes/file-manager/index.tsx | 5 ++-- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/app/components/lib/filesize.ts b/app/components/lib/filesize.ts index f47fde4..17a21e7 100644 --- a/app/components/lib/filesize.ts +++ b/app/components/lib/filesize.ts @@ -37,5 +37,5 @@ export default function filesize(bytes: number, fixed = 1, spec: keyof typeof SP _bytes /= radix; ++loop; } - return `${bytes.toFixed(fixed)} ${unit[loop]}`; + return `${_bytes.toFixed(fixed)} ${unit[loop]}`; } diff --git a/app/routes/file-manager/columns.tsx b/app/routes/file-manager/columns.tsx index 5cd81ea..a5b23d8 100644 --- a/app/routes/file-manager/columns.tsx +++ b/app/routes/file-manager/columns.tsx @@ -27,29 +27,29 @@ export type File = { }; export const columns: ColumnDef[] = [ - { - id: "select", - size: 20, - header: ({ table }) => ( - table.toggleAllPageRowsSelected(!!value)} - aria-label="Select all" - /> - ), - cell: ({ row }) => ( - row.toggleSelected(!!value)} - aria-label="Select row" - /> - ), - enableSorting: false, - enableHiding: false, - }, + // { + // id: "select", + // size: 20, + // header: ({ table }) => ( + // table.toggleAllPageRowsSelected(!!value)} + // aria-label="Select all" + // /> + // ), + // cell: ({ row }) => ( + // row.toggleSelected(!!value)} + // aria-label="Select row" + // /> + // ), + // enableSorting: false, + // enableHiding: false, + // }, { accessorKey: "cid", header: "CID", diff --git a/app/routes/file-manager/index.tsx b/app/routes/file-manager/index.tsx index dca42a1..e48dff7 100644 --- a/app/routes/file-manager/index.tsx +++ b/app/routes/file-manager/index.tsx @@ -64,10 +64,11 @@ export default function FileManager() { placeholder="Search files by name or CID" className="border-ring font-medium w-full grow h-12 flex-1 bg-primary-2/10" /> - + */}