"use client"; import type { BaseRecord } from "@refinedev/core"; import { List, useTable } from "@refinedev/antd"; import { Alert, Empty, Form, Input, Select, Space, Table, type TableColumnsType } from "antd"; import type { ReactNode } from "react"; export type ResourceFilterOption = { label: string; value: string }; export function ResourceTable({ resource, title, columns, statusOptions, extra, }: { resource: string; title: string; columns: TableColumnsType; statusOptions?: ResourceFilterOption[]; extra?: ReactNode; }) { const { tableProps, searchFormProps, tableQuery } = useTable({ resource, syncWithLocation: true, pagination: { pageSize: 20 }, onSearch(values) { return [ { field: "q", operator: "contains", value: values.q }, { field: "status", operator: "eq", value: values.status }, ]; }, }); const error = tableQuery.error; return (
{statusOptions && (