<div class="description">
    <p>
        {{ $data['sub'] }}
    </p>
</div>
<form method="post" action="{{ route('calendar.store') }}" class="settings">
    @csrf

    <input type="hidden" name="redirect" value="{{ $redirect ?? route('calendar.index') }}">

    <div class="input-row input-row--1">
        <div class="input-cell">
            <x-input.label for="name" :value="__('Name')" />
            <x-input.text id="name" name="name" type="text" :value="old('name', $defaults['name'] ?? '')" required />
            <x-input.error :messages="$errors->get('name')" />
        </div>
    </div>

    <div class="input-row input-row--1">
        <div class="input-cell">
            <x-input.label for="description" :value="__('Description')" />
            <x-input.textarea id="description" name="description" type="text" :value="old('description', $defaults['description'] ?? '')" />
            <x-input.error :messages="$errors->get('description')" />
        </div>
    </div>

    <div class="input-row input-row--1-1">
        <div class="input-cell">
            <x-input.label for="timezone" :value="__('common.timezone')" />
            <x-input.select
                id="timezone"
                name="timezone"
                placeholder="{{ __('common.timezone_select') }}"
                :options="$timezones"
                :selected="old('timezone', $user->timezone ?? '')"
                :description="__('calendar.timezone_help')" />
            <x-input.error :messages="$errors->get('timezone')" />
        </div>

        <div class="input-cell">
            <x-input.label for="color" :value="__('Color')" />
            <x-input.color-picker id="color" name="color" :value="old('color', $defaults['color'] ?? default_calendar_color())" />
            <x-input.error :messages="$errors->get('color')" />
        </div>
    </div>

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