@extends('layouts.admin.theme')
@section('title', env('APP_NAME') . ' :: ' . __('Editar tipo'))

@section('content')
    @include('errors.messageFlash')
    <div class="card shadow-sm">
        @php $headLine = "<i class='fa-solid fa-pen-to-square'></i> " . __('Editar tipo'); @endphp
        @include('components.buttons._headLineButtonsBackAdd', [
            'headLine' => __($headLine),
            'routeBack' => 'admin.legislacao.cadastros.index',
            'routeBackParams' => array_merge(['aba' => 'tipos'], $filterParams ?? []),
            'nameBack' => __('Cadastros'),
            'permission' => 'GERENCIADOR_DE_LEGISLACAO',
        ])
        <div class="card-body">
            <form method="post" action="{{ route('admin.legislacao.tipos.update', $tipo) }}">
                @csrf
                @method('put')
                @foreach($filterParams ?? [] as $key => $value)
                    @if($value !== null && $value !== '')
                        <input type="hidden" name="{{ $key }}" value="{{ $value }}">
                    @endif
                @endforeach
                <label class="form-label">{{ __('Descrição') }}</label>
                <input type="text" name="ds_tipo_legislacao" class="form-control" required maxlength="120"
                    value="{{ old('ds_tipo_legislacao', $tipo->ds_tipo_legislacao) }}">
                <div class="mt-3 d-flex justify-content-end">
                    <button type="submit" class="btn btn-success px-4">
                        <i class="fa-solid fa-floppy-disk me-1" aria-hidden="true"></i>{{ __('Salvar') }}
                    </button>
                </div>
            </form>
        </div>
    </div>
@endsection
