@props([
    'action',
    'method' => 'POST',
    'policy' => null,
    'submitLabel',
])

<form method="POST" action="{{ $action }}" novalidate>
    @csrf
    @if (strtoupper($method) !== 'POST')
        @method($method)
    @endif

    <div class="card">
        <div class="card-body">
            <div class="row g-3">
                <div class="col-md-6">
                    <x-ui.form.input name="name" :label="__('overtime.rates.fields.name')" :value="old('name', $policy?->name)" required />
                </div>
                <div class="col-md-3">
                    <x-ui.form.input name="normal_multiplier" type="number" step="0.01" min="0" max="10" :label="__('overtime.rates.fields.normal_multiplier')" :value="old('normal_multiplier', $policy?->normal_multiplier ?? 1)" required />
                </div>
                <div class="col-md-3">
                    <x-ui.form.input name="weekend_multiplier" type="number" step="0.01" min="0" max="10" :label="__('overtime.rates.fields.weekend_multiplier')" :value="old('weekend_multiplier', $policy?->weekend_multiplier ?? 1.5)" required />
                </div>
                <div class="col-md-3">
                    <x-ui.form.input name="holiday_multiplier" type="number" step="0.01" min="0" max="10" :label="__('overtime.rates.fields.holiday_multiplier')" :value="old('holiday_multiplier', $policy?->holiday_multiplier ?? 2)" required />
                </div>
                <div class="col-md-3">
                    <x-ui.form.input name="night_multiplier" type="number" step="0.01" min="0" max="10" :label="__('overtime.rates.fields.night_multiplier')" :value="old('night_multiplier', $policy?->night_multiplier ?? 1.5)" required />
                </div>
                <div class="col-12">
                    <x-ui.form.checkbox name="is_default" :label="__('overtime.rates.fields.is_default')" :checked="old('is_default', $policy?->is_default ?? false)" />
                    <div class="form-text">{{ __('overtime.rates.hints.is_default') }}</div>
                </div>
                <div class="col-12">
                    <x-ui.form.checkbox name="is_active" :label="__('overtime.rates.status.active')" :checked="old('is_active', $policy?->is_active ?? true)" />
                </div>
                <div class="col-12">
                    <x-ui.buttons.primary type="submit" icon="fe fe-save">
                        {{ $submitLabel }}
                    </x-ui.buttons.primary>
                </div>
            </div>
        </div>
    </div>
</form>
