fix: filesize lib was buggy. removed selection options as we dont use thos

This commit is contained in:
Juan Di Toro 2024-03-27 07:34:52 +01:00
parent ffef784f50
commit 4cadd0072d
3 changed files with 27 additions and 26 deletions

View File

@ -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]}`;
}

View File

@ -27,29 +27,29 @@ export type File = {
};
export const columns: ColumnDef<FileItem>[] = [
{
id: "select",
size: 20,
header: ({ table }) => (
<Checkbox
checked={
table.getIsAllPageRowsSelected() ||
(table.getIsSomePageRowsSelected() && "indeterminate")
}
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
aria-label="Select all"
/>
),
cell: ({ row }) => (
<Checkbox
checked={row.getIsSelected()}
onCheckedChange={(value) => row.toggleSelected(!!value)}
aria-label="Select row"
/>
),
enableSorting: false,
enableHiding: false,
},
// {
// id: "select",
// size: 20,
// header: ({ table }) => (
// <Checkbox
// checked={
// table.getIsAllPageRowsSelected() ||
// (table.getIsSomePageRowsSelected() && "indeterminate")
// }
// onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
// aria-label="Select all"
// />
// ),
// cell: ({ row }) => (
// <Checkbox
// checked={row.getIsSelected()}
// onCheckedChange={(value) => row.toggleSelected(!!value)}
// aria-label="Select row"
// />
// ),
// enableSorting: false,
// enableHiding: false,
// },
{
accessorKey: "cid",
header: "CID",

View File

@ -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"
/>
<Button className="h-12 gap-x-2">
{/* We dont yet have any functionality for selecting so im commenting this out */}
{/* <Button className="h-12 gap-x-2">
<AddIcon />
Select All
</Button>
</Button> */}
<DialogTrigger asChild>
<Button className="h-12 gap-x-2">
<AddIcon />