fixed some params and ui
This commit is contained in:
@@ -8,6 +8,7 @@ import { TableSearchInput } from "@/components/tableSearch";
|
||||
import { CreateButton } from "@/components/createButton";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { InfiniteSelect } from "@/components/infiniteSelect";
|
||||
|
||||
// ─── Types ────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -19,8 +20,18 @@ export interface ColumnMeta {
|
||||
export interface FilterField {
|
||||
id: string;
|
||||
label: string;
|
||||
type?: "select" | "text";
|
||||
type?: "select" | "text" | "infinite-select";
|
||||
options?: { value: string; label: string }[];
|
||||
|
||||
// Infinite Select props
|
||||
loading?: boolean;
|
||||
isLoadingMore?: boolean;
|
||||
hasNextPage?: boolean;
|
||||
onLoadMore?: () => void;
|
||||
searchValue?: string;
|
||||
onSearchChange?: (value: string) => void;
|
||||
searchPlaceholder?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface ActiveFilter {
|
||||
@@ -271,6 +282,23 @@ function FilterDropdown({
|
||||
</button>
|
||||
)}
|
||||
</>
|
||||
) : field.type === "infinite-select" ? (
|
||||
<div className="flex-1 min-w-0">
|
||||
<InfiniteSelect
|
||||
value={current}
|
||||
onChange={(val) => onFilterChange(field.id, val)}
|
||||
options={field.options}
|
||||
placeholder="—"
|
||||
searchPlaceholder={field.searchPlaceholder || t("common.search", "Gözle...")}
|
||||
disabled={field.disabled}
|
||||
loading={field.loading}
|
||||
isLoadingMore={field.isLoadingMore}
|
||||
hasNextPage={field.hasNextPage}
|
||||
onLoadMore={field.onLoadMore}
|
||||
searchValue={field.searchValue}
|
||||
onSearchChange={field.onSearchChange}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<Select value={current || "__all__"} onValueChange={(val) => onFilterChange(field.id, val === "__all__" ? "" : val)}>
|
||||
|
||||
Reference in New Issue
Block a user