<script lang="ts">
	import Svelecte from "svelecte";

	type Group = { label: string; options: Option[] };
	type Option = { label: string; value: string };

	export let options: Array<Group | Option>;
	export let multiple = false;
	export let max: number | undefined = undefined;
	export let placeholder: string = "Select a channel";
	export let value: string | string[] | null;
</script>

<Svelecte
	bind:value
	{options}
	{placeholder}
	{multiple}
	{max}
	labelField="label"
	valueField="value"
	groupLabelField="label"
	groupItemsField="options"
	searchable={true}
/>
