fix: Added resurce and dataProvider props to data-table, fixed UI
This commit is contained in:
parent
b646fc4887
commit
39a8789f95
|
@ -18,16 +18,21 @@ import { Skeleton } from "./ui/skeleton";
|
|||
import { DataTablePagination } from "./table-pagination"
|
||||
|
||||
interface DataTableProps<TData extends BaseRecord = BaseRecord, TValue = unknown> {
|
||||
columns: ColumnDef<TData, TValue>[]
|
||||
columns: ColumnDef<TData, TValue>[],
|
||||
resource: string;
|
||||
dataProviderName?: string;
|
||||
}
|
||||
|
||||
export function DataTable<TData extends BaseRecord, TValue>({
|
||||
columns,
|
||||
resource,
|
||||
dataProviderName
|
||||
}: DataTableProps<TData, TValue>) {
|
||||
const table = useTable({
|
||||
columns,
|
||||
refineCoreProps: {
|
||||
resource: "files"
|
||||
resource,
|
||||
dataProviderName: dataProviderName || "default"
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ export const PinningNetworkBanner = () => {
|
|||
<Accordion type="single" defaultValue="item-1" collapsible>
|
||||
<AccordionItem value="item-1">
|
||||
<AccordionTrigger className="font-bold bg-primary px-4 rounded-tr-lg rounded-tl-lg">
|
||||
{itemsLeft.length > 0 ? `${itemsLeft.length} left` : "Completed"}
|
||||
{`${completedItems.length}/${cidList.length} items completed`}
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<Tabs className="w-full" defaultValue="inProgress">
|
||||
|
|
|
@ -48,6 +48,7 @@ export default function App() {
|
|||
notificationProvider={notificationProvider}
|
||||
dataProvider={{
|
||||
default: providers.default,
|
||||
files: providers.files,
|
||||
pinning: providers.pinning
|
||||
}}
|
||||
resources={resources}
|
||||
|
|
|
@ -46,7 +46,7 @@ const CreatedOnCell = ({ row }: { row: Row<File> }) => {
|
|||
onPin(row.getValue("cid"));
|
||||
}}>
|
||||
<DrawingPinIcon className="mr-2" />
|
||||
Ping CID
|
||||
Pin CID
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem variant="destructive">
|
||||
|
|
|
@ -55,6 +55,8 @@ export default function FileManager() {
|
|||
</div>
|
||||
<DataTable
|
||||
columns={columns}
|
||||
resource="file"
|
||||
dataProviderName="files"
|
||||
/>
|
||||
</GeneralLayout>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue