✨ added POST-endpoint for userform
Co-authored-by: haraldnilsen <harald_998@hotmail.com> Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
b78003b4fc
commit
dd8f22b043
7 changed files with 74 additions and 18 deletions
|
|
@ -1,12 +1,18 @@
|
|||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
const dispatch = createEventDispatcher();
|
||||
function handleButtonClick(selectedValue: string) {
|
||||
dispatch('update', selectedValue);
|
||||
}
|
||||
export let options:string[]
|
||||
export let selected: string
|
||||
</script>
|
||||
|
||||
<div class="flex justify-between w-full">
|
||||
{#each options as data, index (data)}
|
||||
<div class="flex flex-col justify-start items-center w-12 text-center">
|
||||
<button name={data} class="h-6 w-6 rounded-full border-2 border-primary hover:bg-primary"></button>
|
||||
<button name={data} on:click={() => handleButtonClick(data)} class="flex flex-col justify-start items-center w-12 text-center">
|
||||
<div class={`${selected == data && "bg-primary"} h-6 w-6 rounded-full border-2 border-primary hover:bg-primary`}></div>
|
||||
<label class="text-primary text-sm mt-1" for={data}>{data}</label>
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue