Changes in Image-Gallery Page then DateRange cross button will work correctly.

This commit is contained in:
Kartik Sharma 2025-09-20 14:33:22 +05:30
parent d4be35b44d
commit eaccf0fca2

View File

@ -99,15 +99,23 @@ const ImageGalleryPage = () => {
const handleRemoveFilter = (filterKey, valueId) => {
setAppliedFilters((prev) => {
const updated = { ...prev };
if (Array.isArray(updated[filterKey])) {
updated[filterKey] = updated[filterKey].filter((id) => id !== valueId);
} else if (filterKey === "startDate" || filterKey === "endDate") {
}
else if (filterKey === "startDate" || filterKey === "endDate") {
updated[filterKey] = null;
}
else if (filterKey === "dateRange") {
updated.startDate = null;
updated.endDate = null;
}
return updated;
});
};
// --- Chips ---
const appliedFiltersChips = useMemo(() => {
const chips = [];