From 39a8789f95564b568bf6617d921357643381c5c1 Mon Sep 17 00:00:00 2001 From: Tania Gutierrez Date: Thu, 21 Mar 2024 10:56:08 -0400 Subject: [PATCH] fix: Added resurce and dataProvider props to data-table, fixed UI --- app/components/data-table.tsx | 9 +++++++-- app/components/pinnning-network-banner.tsx | 2 +- app/root.tsx | 1 + app/routes/file-manager/columns.tsx | 2 +- app/routes/file-manager/index.tsx | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/components/data-table.tsx b/app/components/data-table.tsx index 79f9b5b..f989308 100644 --- a/app/components/data-table.tsx +++ b/app/components/data-table.tsx @@ -18,16 +18,21 @@ import { Skeleton } from "./ui/skeleton"; import { DataTablePagination } from "./table-pagination" interface DataTableProps { - columns: ColumnDef[] + columns: ColumnDef[], + resource: string; + dataProviderName?: string; } export function DataTable({ columns, + resource, + dataProviderName }: DataTableProps) { const table = useTable({ columns, refineCoreProps: { - resource: "files" + resource, + dataProviderName: dataProviderName || "default" } }) diff --git a/app/components/pinnning-network-banner.tsx b/app/components/pinnning-network-banner.tsx index d521914..98c12a0 100644 --- a/app/components/pinnning-network-banner.tsx +++ b/app/components/pinnning-network-banner.tsx @@ -33,7 +33,7 @@ export const PinningNetworkBanner = () => { - {itemsLeft.length > 0 ? `${itemsLeft.length} left` : "Completed"} + {`${completedItems.length}/${cidList.length} items completed`} diff --git a/app/root.tsx b/app/root.tsx index 6f0e1fa..0d1d3cb 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -48,6 +48,7 @@ export default function App() { notificationProvider={notificationProvider} dataProvider={{ default: providers.default, + files: providers.files, pinning: providers.pinning }} resources={resources} diff --git a/app/routes/file-manager/columns.tsx b/app/routes/file-manager/columns.tsx index 67ec095..e56c63f 100644 --- a/app/routes/file-manager/columns.tsx +++ b/app/routes/file-manager/columns.tsx @@ -46,7 +46,7 @@ const CreatedOnCell = ({ row }: { row: Row }) => { onPin(row.getValue("cid")); }}> - Ping CID + Pin CID diff --git a/app/routes/file-manager/index.tsx b/app/routes/file-manager/index.tsx index 96a5777..e875b4f 100644 --- a/app/routes/file-manager/index.tsx +++ b/app/routes/file-manager/index.tsx @@ -55,6 +55,8 @@ export default function FileManager() { );