"use client"; import { Table } from "@tanstack/react-table"; import { Input } from "@/components/ui/input"; import { Search } from "lucide-react"; interface DataTableToolbarProps { table: Table; searchKey?: string; onSearch?: (value: string) => void; } export function DataTableToolbar({ table, searchKey, onSearch, }: DataTableToolbarProps) { return (
{searchKey && (
{ const value = event.target.value; table.getColumn(searchKey)?.setFilterValue(value); onSearch?.(value); }} className="pl-10" />
)}
); }