team-1/frontend/src/lib/components/SuggestionInput.svelte

16 lines
514 B
Svelte
Raw Normal View History

2025-08-01 21:10:03 +02:00
<script lang="ts">
2025-08-02 02:12:41 +02:00
let { roomId } = $props()
let input = $state("")
async function sendSong() {
let resp = await fetch(`/api/addsong?room=${roomId}&query=${input}`, { method: "POST" })
input = ""
}
2025-08-01 21:10:03 +02:00
</script>
<div class="flex h-full w-full flex-row items-center gap-2 rounded border-2 border-black p-4">
2025-08-02 02:12:41 +02:00
<input type="text" placeholder="Song & Artist" class="h-full w-3/4 rounded" bind:value={input} />
<button class="w-1/4 rounded" onclick={sendSong}>Send</button>
2025-08-01 21:10:03 +02:00
</div>