"use client" import * as React from "react" import type { DataTableAdvancedFilterField } from "@/types/table" import { type Table } from "@tanstack/react-table" import { cn } from "@/lib/utils" import { DataTableFilterList } from "@/components/data-table/data-table-filter-list" import { DataTableSortList } from "@/components/data-table/data-table-sort-list" import { DataTableViewOptions } from "@/components/data-table/data-table-view-options" import { DataTablePinList } from "./data-table-pin" import { PinLeftButton } from "./data-table-pin-left" import { PinRightButton } from "./data-table-pin-right" import { DataTableGlobalFilter } from "./data-table-grobal-filter" import { DataTableGroupList } from "./data-table-group-list" interface DataTableAdvancedToolbarProps extends React.HTMLAttributes { /** * The table instance returned from useDataTable hook with pagination, sorting, filtering, etc. * @type Table */ table: Table /** * An array of filter field configurations for the data table. * @type DataTableAdvancedFilterField[] * @example * const filterFields = [ * { * id: 'name', * label: 'Name', * type: 'text', * placeholder: 'Filter by name...' * }, * { * id: 'status', * label: 'Status', * type: 'select', * options: [ * { label: 'Active', value: 'active', count: 10 }, * { label: 'Inactive', value: 'inactive', count: 5 } * ] * } * ] */ filterFields: DataTableAdvancedFilterField[] /** * Debounce time (ms) for filter updates to enhance performance during rapid input. * @default 300 */ debounceMs?: number /** * Shallow mode keeps query states client-side, avoiding server calls. * Setting to `false` triggers a network request with the updated querystring. * @default true */ shallow?: boolean } export function DataTableAdvancedToolbar({ table, filterFields = [], debounceMs = 300, shallow = true, children, className, ...props }: DataTableAdvancedToolbarProps) { return (
{children}
) }