feat: delete unnecessary components

This commit is contained in:
Ilia Mashkov
2026-01-02 20:03:20 +03:00
parent 90899c0b3b
commit 949c7c1b48
7 changed files with 52 additions and 29 deletions

View File

@@ -77,6 +77,12 @@ export interface FilterStore<T extends FilterModel> extends Writable<T> {
* @param category - Category to deselect
*/
deselectCategory: (categoryId: string) => void;
/**
* Toggle a category.
*
* @param categoryId - Category ID
*/
toggleCategory: (categoryId: string) => void;
/**
* Select all categories.
*/
@@ -185,6 +191,19 @@ export function createFilterStore<T extends FilterModel>(
),
}));
},
/**
* Toggle a category.
*
* @param categoryId - Category ID
*/
toggleCategory: (categoryId: string) => {
update(state => ({
...state,
categories: state.categories.map(c =>
c.id === categoryId ? { ...c, selected: !c.selected } : c
),
}));
},
/**
* Select all categories
*/

View File

@@ -110,7 +110,7 @@ const hasSelection = $derived(selectedCount > 0);
class="border-t"
>
<div class="px-4 py-3">
<div class="flex flex-col gap-2.5">
<div class="flex flex-col gap-1.5">
<!-- Each item: checkbox + label with interactive hover/focus states -->
<!-- Keyed by category.id for efficient DOM updates -->
{#each categories as category (category.id)}