<script>import { key } from '../../context/accordion';
import { writable } from 'svelte/store';
import { createEventDispatcher, setContext } from 'svelte';
export let multiple = false;
let data = writable('');
const dispatch = createEventDispatcher();
setContext(key, {
    data,
    multiple,
    set: (key, open) => {
        data.set(open ? key : '');
    }
});
data.subscribe((i) => {
    dispatch('click', { selected: $data });
});
</script>

<div class="UI-Accordion">
	<slot />
</div>

<style>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}</style>
