@extends('layouts.admin.theme')
@section("title", env("APP_NAME") . " :: Visite Angra - Nova Categoria")
@section('content')

    <div class="container">
        <div class="row">
            <div class="col-12 mt-5">
                <div class="card shadow">
                    <form action="{{ route('admin.visiteAngra.categorias.store') }}" method="post" enctype="multipart/form-data">

                        @php $headLine = "<i class='fa-solid fa-layer-group fa-2x'></i> Visite Angra - Nova Categoria"; @endphp

                        @include('components.buttons._headLineButtonsBackAdd', [
                            'headLine' => __($headLine),
                            'routeBack' => 'admin.visiteAngra.categorias.index',
                            'routeBackParams' => [], 
                            'nameBack' => __("Voltar"),
                            "permission" => "GERENCIADOR_VISITE_ANGRA",
                        ])

                        <div class="card-body">

                            @csrf
                            @include("errors.messageFlash")

                            <div class="mb-3">

                            <!-- Campo Tipo -->
                                @include('components.inputs._selectType', [
                                        "for" => "tipo",
                                        "label" => "Tipo",
                                        "name" => "tipo",
                                        "required" => true,
                                        "readonly" => false,
                                        "options" => collect(App\Enums\StatusTipoCategoriaVisiteAngra::cases())
                                            ->mapWithKeys(fn($status) => [$status->name => $status->value])
                                            ->toArray(),
                                        "selected" => old('status'),
                                        "placeholder" => "Selecione o tipo...",
                                        "small" => "Informe o tipo de categoria.",
                                        "onchange" => null
                                    ])

                            </div>

                            <div class="mb-3">
                                
                                <!-- Campo Categoria -->
                                @include('components.inputs._inputType',[
                                        "for" => null,
                                        "label" => "Categoria",
                                        "name" => "categoria",
                                        "id" => null,
                                        "required" => true,
                                        "type" => null,
                                        "old" => old('categoria'),
                                        "oninput" => null,
                                        "readonly" => false,
                                        "small" => null,
                                    ])
                                
                            </div>

                            <div class="mb-3">
                                <!-- Campo Status -->
                                @include('components.inputs._selectType', [
                                        "for" => "status",
                                        "label" => "Status",
                                        "name" => "status",
                                        "required" => true,
                                        "readonly" => false,
                                        "options" => collect(App\Enums\StatusEnum::cases())
                                            ->mapWithKeys(fn($status) => [$status->name => $status->value])
                                            ->toArray(),
                                        "selected" => old('status'),
                                        "placeholder" => "Selecione o status...",
                                        "small" => "Informe o status atual da categoria.",
                                        "onchange" => null
                                    ])
                            </div>

                            @include('components.buttons._backAndSend',[
                                'routeBack' => 'admin.visiteAngra.categorias.index',
                                'textBack' => "Voltar",
                                'textSend' => "Cadastrar",
                            ])

                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection