<script>
    import { createEventDispatcher } from 'svelte';

    import Setting from './Setting.svelte';

    export let title;
    export let value;

    const dispatch = createEventDispatcher();
</script>


<Setting {title}>
    <input 
        slot="input" 
        type="checkbox" 
        class="toggle toggle-success"
        bind:checked={value}
        on:change={e => dispatch('update', {value: e.target.checked})}
    />
    <slot name="description" slot="description"></slot>
</Setting>