always show add topic

This commit is contained in:
2025-03-23 02:02:31 +01:00
parent 9211070ab2
commit cccf2137a4

View File

@@ -47,13 +47,7 @@
<Command.Root>
<Command.Input bind:value={search} placeholder="Search topic..." />
<Command.List>
<Command.Empty>
<form method="post" action="?/createTopic">
<input type="hidden" name="name" value={search} />
<button class="px-4 py-2 rounded bg-secondary">Add Topic</button>
</form>
</Command.Empty>
<div class="flex flex-col items-center p-2">
<Command.Group>
{#each data.topics as topic}
<form
@@ -71,13 +65,22 @@
}}
>
<Check
class={cn('mr-2 size-4', value !== topic.id.toString() && 'text-transparent')}
class={cn(
'mr-2 size-4',
value !== topic.id.toString() && 'text-transparent'
)}
/>
{topic.name}
</Command.Item>
</form>
{/each}
</Command.Group>
<form method="post" action="?/createTopic">
<input type="hidden" name="name" value={search} />
<button class="px-4 py-2 rounded bg-secondary">Add Topic</button>
</form>
</div>
</Command.List>
</Command.Root>
</Popover.Content>