fixed some params and ui

This commit is contained in:
Jelaletdin12
2026-08-25 22:58:08 +05:00
parent f00d2abcac
commit f293806d96
25 changed files with 547 additions and 87 deletions

View File

@@ -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)}>