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

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