@extends('admin.layouts.app')
@section('title', __('admin/dns-zones.add'))
@section('content')
<div class="container-fluid px-4">
    <x-admin.page-header :title="__('admin/dns-zones.add')" icon="fas fa-globe"
        :buttons="[['label' => __('admin/common.back'), 'route' => route('admin.dns-zones.index'),
                     'icon' => 'fas fa-arrow-left', 'color' => 'outline-secondary']]" />
    <x-admin.validation-errors />
    <form method="POST" action="{{ route('admin.dns-zones.store') }}">
        @csrf
        <x-admin.card>
            <div class="mb-3">
                <label class="form-label">{{ __('admin/dns-zones.fields_domain') }} <span class="text-danger">*</span></label>
                <input type="text" name="domain" class="form-control" value="{{ old('domain') }}" required placeholder="example.com">
            </div>
            <div class="mb-3">
                <label class="form-label">{{ __('admin/dns-zones.fields_provider') }} <span class="text-danger">*</span></label>
                <select name="provider" class="form-select" required>
                    @foreach($providers as $key => $info)
                        <option value="{{ $key }}" {{ old('provider') === $key ? 'selected' : '' }}>{{ $info['label'] }}</option>
                    @endforeach
                </select>
            </div>
            <div class="mb-3">
                <label class="form-label">{{ __('admin/dns-zones.fields_client') }} (optional)</label>
                <input type="number" name="client_id" class="form-control" value="{{ old('client_id') }}" placeholder="Client ID">
            </div>
            <x-slot:footer>
                <x-admin.form-actions :cancel-url="route('admin.dns-zones.index')" />
            </x-slot:footer>
        </x-admin.card>
    </form>
</div>
@endsection
