<script lang="ts">
	import { idFromLabel } from '$lib/Utils';

	export let label: string;

	const id = idFromLabel(label);
</script>

<div class="flex flex-col">
	<div class="flex">
		<label for={id}>{label}</label>
		{#if $$slots.controls}
			<div class="grow" />
			<slot name="controls" />
		{/if}
	</div>
	<slot {id} />
</div>
