<script>
	export let label;
	export let id;
	export let options = [];
	export let value;
	export let handleSelect;
	export let element;

	console.log(`options: ${JSON.stringify(options)}`)

</script>

<label class="label" for={id}>{label}</label>
<select name={id} {id} bind:value on:change={handleSelect}>
	{#each options as option}
		{#if element}
			<option value={option}>{option[element]}</option>
		{:else}
			<option value={option}>{option}</option>
		{/if}	
	{/each}
</select>

<style>
	.label {
		border: 2px solid #555;
		background-color: gray;
		border-radius: 8px;
		padding: 2px;
		width: fit-content;
	}

	select {
		font-size: 1.2rem;
		width: fit-content;
	}
</style>
