fix(chapters): removed filters when no data
This commit is contained in:
parent
66f16ec248
commit
56bae8c72f
1 changed files with 45 additions and 41 deletions
|
@ -102,48 +102,52 @@
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="flex flex-col md:flex-row gap-2">
|
<div class="flex flex-col gap-2 md:flex-row">
|
||||||
<Input bind:value={name} placeholder="Rechercher un puzzle" />
|
<Input bind:value={name} placeholder="Rechercher un puzzle" />
|
||||||
<Select.Root
|
{#if Object.keys(themes).length}
|
||||||
multiple
|
<Select.Root
|
||||||
selected={themeList.map((theme) => ({ label: theme, value: theme }))}
|
multiple
|
||||||
onSelectedChange={(v) => {
|
selected={themeList.map((theme) => ({ label: theme, value: theme }))}
|
||||||
if (v) {
|
onSelectedChange={(v) => {
|
||||||
themeList = v.map((item) => item.value);
|
if (v) {
|
||||||
} else {
|
themeList = v.map((item) => item.value);
|
||||||
themeList = [];
|
} else {
|
||||||
}
|
themeList = [];
|
||||||
}}
|
}
|
||||||
>
|
}}
|
||||||
<Select.Trigger class="md:w-[180px]">
|
>
|
||||||
<Select.Value placeholder="Thème" />
|
<Select.Trigger class="md:w-[180px]">
|
||||||
</Select.Trigger>
|
<Select.Value placeholder="Thème" />
|
||||||
<Select.Content>
|
</Select.Trigger>
|
||||||
{#each Object.entries(themes) as [key, value]}
|
<Select.Content>
|
||||||
<Select.Item {value}>{key}</Select.Item>
|
{#each Object.entries(themes) as [key, value]}
|
||||||
{/each}
|
<Select.Item {value}>{key}</Select.Item>
|
||||||
</Select.Content>
|
{/each}
|
||||||
</Select.Root>
|
</Select.Content>
|
||||||
<Select.Root
|
</Select.Root>
|
||||||
multiple
|
{/if}
|
||||||
selected={difficultyList.map((difficulty) => ({ label: difficulty, value: difficulty }))}
|
{#if Object.keys(difficulties).length}
|
||||||
onSelectedChange={(v) => {
|
<Select.Root
|
||||||
if (v) {
|
multiple
|
||||||
difficultyList = v.map((item) => item.value);
|
selected={difficultyList.map((difficulty) => ({ label: difficulty, value: difficulty }))}
|
||||||
} else {
|
onSelectedChange={(v) => {
|
||||||
difficultyList = [];
|
if (v) {
|
||||||
}
|
difficultyList = v.map((item) => item.value);
|
||||||
}}
|
} else {
|
||||||
>
|
difficultyList = [];
|
||||||
<Select.Trigger class="md:w-[180px]">
|
}
|
||||||
<Select.Value placeholder="Difficulté" />
|
}}
|
||||||
</Select.Trigger>
|
>
|
||||||
<Select.Content>
|
<Select.Trigger class="md:w-[180px]">
|
||||||
{#each Object.entries(difficulties) as [key, value]}
|
<Select.Value placeholder="Difficulté" />
|
||||||
<Select.Item {value}>{key}</Select.Item>
|
</Select.Trigger>
|
||||||
{/each}
|
<Select.Content>
|
||||||
</Select.Content>
|
{#each Object.entries(difficulties) as [key, value]}
|
||||||
</Select.Root>
|
<Select.Item {value}>{key}</Select.Item>
|
||||||
|
{/each}
|
||||||
|
</Select.Content>
|
||||||
|
</Select.Root>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<ul class="flex flex-col gap-2">
|
<ul class="flex flex-col gap-2">
|
||||||
{#if !filteredPuzzles.length}
|
{#if !filteredPuzzles.length}
|
||||||
|
|
Loading…
Add table
Reference in a new issue