new components for radio and select

Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
haraldnilsen 2023-12-12 19:38:41 +01:00
parent 9aa16763c6
commit 7c3f87079b
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,17 @@
<script lang="ts">
export let inputType:string
export let label:string
export let options: string[]
import RadioButtons from "./inputs/RadioButtons.svelte"
import Select from "./inputs/Select.svelte";
</script>
<div class="flex justify-start items-center h-1/4 w-full ">
<p class="text-primary font-bold">{label}:</p>
{#if inputType == "radio"}
<RadioButtons options={options}/>
{/if}
{#if inputType == "select"}
<Select options={options}/>
{/if}
</div>