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.Root>
<Command.Input bind:value={search} placeholder="Search topic..." /> <Command.Input bind:value={search} placeholder="Search topic..." />
<Command.List> <Command.List>
<Command.Empty> <div class="flex flex-col items-center p-2">
<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>
<Command.Group> <Command.Group>
{#each data.topics as topic} {#each data.topics as topic}
<form <form
@@ -71,13 +65,22 @@
}} }}
> >
<Check <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} {topic.name}
</Command.Item> </Command.Item>
</form> </form>
{/each} {/each}
</Command.Group> </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.List>
</Command.Root> </Command.Root>
</Popover.Content> </Popover.Content>