@php($defaults = $data['defaults'] ?? [])
@php($weekStart = $defaults['week_start'] ?? 'monday')

<div class="description">
    <p>
        {{ $data['sub'] }}
    </p>
</div>

<form method="post" action="{{ route('calendar.settings.display.store') }}" class="settings">
    @csrf

    <div class="input-row input-row--1">
        <div class="input-cell">
            <x-input.label for="name" :value="__('Start of the week')" />
            <div class="button-group button-group--primary self-start">
                <x-button.group-input value="sunday" name="week_start" :active="$weekStart === 'sunday'">{{ __('Sunday') }}</x-button.group-input>
                <x-button.group-input value="monday" name="week_start" :active="$weekStart === 'monday'">{{ __('Monday') }}</x-button.group-input>
            </div>
            <x-input.error :messages="$errors->get('week_start')" />
        </div>
    </div>

    <div class="input-row input-row--actions input-row--start sticky-bottom">
        <x-button variant="primary" type="submit">{{ __('common.save_changes') }}</x-button>
        <x-button type="anchor" variant="tertiary" href="{{ route('calendar.settings.display') }}">{{ __('common.cancel') }}</x-button>
    </div>

</form>
