@props([
    'id' => 'switch-' . uniqid(),
    'label' => null,
    'size' => 'md',
    'checked' => false,
    'name' => null,
    'value' => null,
])

<div {{ $attributes->merge(['class' => "form-check form-switch form-switch-$size"]) }}>
    <input
            class="form-check-input"
            type="checkbox"
            role="switch"
            id="{{ $id }}"
            name="{{ $name }}"
            wire:model.live="{{ $name }}"
            value="{{ $value }}"
            {{ $checked ? 'checked' : '' }}
            {{ $attributes->whereDoesntStartWith('class') }}
    >
    @if($label)
        <label class="form-check-label" for="{{ $id }}">
            {{ $label }}
        </label>
    @endif
</div>