File size: 708 Bytes
f45636e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script lang="ts">
  import type { FieldProps } from '$lib/types';
  import { onMount } from 'svelte';
  export let value = '';
  export let params: FieldProps;
  onMount(() => {
    value = String(params?.default);
  });
</script>

<div class="grid max-w-md grid-cols-4 items-center justify-items-start gap-3">
  <label for="model-list" class="font-medium">{params?.title} </label>
  {#if params?.values}
    <select
      bind:value
      id="model-list"
      class="cursor-pointer rounded-md border-2 border-gray-500 p-2 font-light dark:text-black"
    >
      {#each params.values as model, i}
        <option value={model} selected={i === 0}>{model}</option>
      {/each}
    </select>
  {/if}
</div>