import React, { useState, useMemo } from 'react'; import { Search, Check } from 'lucide-react'; import { cn } from '../lib/utils'; interface ColumnFilterPopoverProps { uniqueValues: string[]; selectedValues: string[]; onToggle: (val: string) => void; onSelectAll: (vals: string[]) => void; onClear: () => void; onClose: () => void; title?: string; className?: string; } export function ColumnFilterPopover({ uniqueValues, selectedValues, onToggle, onSelectAll, onClear, onClose, title, className }: ColumnFilterPopoverProps) { const [search, setSearch] = useState(''); const filteredValues = useMemo(() => { return uniqueValues.filter(v => String(v || '').toLowerCase().includes(search.toLowerCase()) ); }, [uniqueValues, search]); const isAllSelected = selectedValues.length === uniqueValues.length && uniqueValues.length > 0; return (