<h3>Cadastro</h3>
<div class="mb-3">
    <input type="hidden" name="slug">
    <label for="type" class="form-label text-bold">Tipo de cadastro: <span class="span-admin-create">*</span></label>
    <select class="form-control @error('type') is-invalid @enderror" name="type" id="type" onchange="javascript:showHideSecretariaID(this.value)">
        @foreach(App\Enums\StructuresTypeStatusEnum::cases() as $types)
            <option value="{{ $types->name }}" {{ old('type') === $types->name ? 'selected' : '' }}>
                {{ $types->value }}
            </option>
        @endforeach
    </select>
    @error('type')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3 @if(!in_array(old('type'), ['SECRETARIA_EXECUTIVA', 'DIRETORIA', 'SUPERINTENDENCIA'])) d-none @endif" id="secretariaDIV">
    <label for="structure_id" class="form-label text-bold">Pertence a: <span class="span-admin-create">*</span></label>
    <select class="form-control" name="structure_id" id="structureID">
        <option value="">{{ __('Selecione...') }}</option>
        @foreach($secretarias as $secretaria)
            <option value="{{ $secretaria->id }}" {{ old('structure_id') == $secretaria->id ? 'selected' : '' }}>
                {{ $secretaria->name }}
            </option>
        @endforeach
    </select>
</div>

<div class="mb-3">
    <label for="name" class="form-label text-bold">Nome do órgão: <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('name') is-invalid @enderror" name="name" id="name" autocomplete="off" value="{{ old('name') }}">
                            @error('name')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3">
    <label for="abbreviation" class="form-label text-bold">Sigla do órgão: <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('abbreviation') is-invalid @enderror" name="abbreviation" id="abbreviation" autocomplete="off" value="{{ old('abbreviation') }}">
                            @error('abbreviation')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3">
    <label for="phoneNumber" class="form-label text-bold">Telefone: <span class="span-admin-create">*</span></label>
    <input type="text" class="form-control @error('phoneNumber') is-invalid @enderror" name="phoneNumber" id="phoneNumber" autocomplete="off" value="{{ old('phoneNumber') }}">
    @error('phoneNumber')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3">
    <label for="banner" class="form-label text-bold">Banner da secretaria:</label>
    <input type="file" class="form-control" name="banner" id="banner" accept="image/jpeg,image/jpg,image/png,image/gif" />
</div>
<div class="mb-3 text-wrap">
    <label for="description" class="form-label text-bold">Informações do órgão: <span class="span-admin-create">*</span></label>
    <textarea class="form-control textarea-comments @error('description') is-invalid @enderror" name="description" id="description">{{ old('description') }}</textarea>
    @error('description')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="openingHours" class="form-label text-bold">Horários de funcionamento:</label>
    <input type="text" class="form-control @error('openingHours') is-invalid @enderror" name="openingHours" id="openingHours" autocomplete="off" value="{{ old('openingHours') }}">
    @error('openingHours')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="serviceHours" class="form-label text-bold">Horários de atendimento:</label>
    <input type="text" class="form-control @error('serviceHours') is-invalid @enderror" name="serviceHours" id="serviceHours" autocomplete="off" value="{{ old('serviceHours') }}">
    @error('serviceHours')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>
@include('components.inputs._textarea', [
    'label' => __('Informações adicionais (página Fale Conosco)'),
    'name' => 'faleConoscoExtraInfo',
    'id' => 'faleConoscoExtraInfo',
    'rows' => 5,
    'required' => false,
    'height' => '400px',
    'class' => 'textarea-body',
    'style' => null,
    'value' => old('faleConoscoExtraInfo'),
])
<small class="text-muted d-block mb-3">{{ __('Campo opcional. Exibido na página Fale Conosco do órgão, entre o horário de atendimento e a localização, sem título.') }}</small>
<div class="mb-3">
    <label for="page_content_type" class="form-label text-bold">{{ __('Tipo de conteúdo da página pública') }}: <span class="span-admin-create">*</span></label>
    <select class="form-control @error('page_content_type') is-invalid @enderror" name="page_content_type" id="page_content_type" onchange="toggleHtmlInfo(this.value)">
        <option value="NOTICIAS" {{ old('page_content_type', 'NOTICIAS') === 'NOTICIAS' ? 'selected' : '' }}>{{ __('Notícias') }}</option>
        <option value="HTML" {{ old('page_content_type') === 'HTML' ? 'selected' : '' }}>{{ __('HTML (Páginas)') }}</option>
        <option value="HTML_NOTICIAS" {{ old('page_content_type') === 'HTML_NOTICIAS' ? 'selected' : '' }}>{{ __('HTML + Notícias') }}</option>
    </select>
    <small class="text-muted">{{ __('Define o que é exibido no corpo da página pública deste órgão.') }}</small>
    @error('page_content_type')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
    <div id="htmlInfoCreate" class="alert alert-info mt-2 @if(!in_array(old('page_content_type'), ['HTML', 'HTML_NOTICIAS'])) d-none @endif">
        <i class="fa-solid fa-circle-info me-1"></i>
        {!! __('Após cadastrar o órgão, acesse a edição para selecionar a página HTML a exibir. Crie a página no módulo <strong>Páginas HTML</strong> vinculando-a a este órgão.') !!}
    </div>
    <input type="hidden" name="html_page_id" value="">
</div>

<div id="pageContentOrderDiv" class="mb-3 @if(old('page_content_type') !== 'HTML_NOTICIAS') d-none @endif">
    <label for="page_content_order" class="form-label text-bold">{{ __('Ordem do conteúdo') }}:</label>
    <select class="form-control @error('page_content_order') is-invalid @enderror" name="page_content_order" id="page_content_order">
        <option value="HTML_FIRST" {{ old('page_content_order', 'HTML_FIRST') === 'HTML_FIRST' ? 'selected' : '' }}>{{ __('HTML > Notícias') }}</option>
        <option value="NEWS_FIRST" {{ old('page_content_order') === 'NEWS_FIRST' ? 'selected' : '' }}>{{ __('Notícias > HTML') }}</option>
    </select>
    @error('page_content_order')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3">
    <label for="status" class="form-label text-bold">Status: <span class="span-admin-create">*</span></label>
    <select class="form-control @error('status') is-invalid @enderror" name="status" id="status">
        @foreach(App\Enums\StatusEnum::cases() as $status)
            <option value="{{ $status->name }}">{{ $status->value }}</option>
        @endforeach
    </select>
    @error('status')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>