@php $preposto = $empresa->preposto @endphp
<div class="mb-3">
    <label for="fullNamePrepostoEmpresa" class="form-label text-bold">
        {{ __("Nome completo") }}:
        <span class="span-admin-create preposto-required d-none">*</span>
    </label>
    <input type="text" class="form-control @error('fullNamePrepostoEmpresa') is-invalid @enderror" name="fullNamePrepostoEmpresa" id="fullNamePrepostoEmpresa" autocomplete="off" value="{{ old('fullNamePrepostoEmpresa', $preposto?->firstName .' '. $preposto?->lastName ) }}">
    @error('fullNamePrepostoEmpresa')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>
<div class="mb-3">
    <label for="cpfPrepostoEmpresa" class="form-label text-bold">
        {{ __("CPF") }}:
        <span class="span-admin-create preposto-required d-none">*</span>
    </label>
    <input type="text" class="form-control @error('cpfPrepostoEmpresa') is-invalid @enderror" name="cpfPrepostoEmpresa" id="cpfPrepostoEmpresa" data-mask="cpf" value="{{ old('cpfPrepostoEmpresa', $preposto?->cpf) }}" autocomplete="off">
    @error('cpfPrepostoEmpresa')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

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

<div class="mb-3">
    <label for="emailPrepostoEmpresa" class="form-label text-bold">
        {{ __("Email") }}:
        <span class="span-admin-create preposto-required d-none">*</span>
    </label>
    <input type="emailPrepostoEmpresa" class="form-control @error('emailPrepostoEmpresa') is-invalid @enderror" name="emailPrepostoEmpresa" id="emailPrepostoEmpresa" autocomplete="off" value="{{ old('emailPrepostoEmpresa', $preposto?->email) }}">
    @error('emailPrepostoEmpresa')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

<div class="mb-3">
    <label for="photoPrepostoEmpresa" class="form-label text-bold">{{ __("Foto") }}:</label>
    <input type="file" class="form-control @error('photoPrepostoEmpresa') is-invalid @enderror" name="photoPrepostoEmpresa" id="photoPrepostoEmpresa" accept="image/jpeg,image/jpg,image/png,image/gif" />
    @error('photoPrepostoEmpresa')
        <small class="text-danger text-bold">{{ $message }}</small>
    @enderror
</div>

@if($empresa?->preposto_id != null)
    <div class="mb-3 w-25">
        @php $index = 2; @endphp
        @include('components.tables._openPhoto',[
            'asset' => $preposto?->photo,
            'alt' => $preposto?->firstName." ".$preposto?->lastName,
            'title' => $preposto?->firstName." ".$preposto?->lastName,
            'text' => __('Visualizar foto'),
        ])
    </div>
@endif

<div class="form-check mb-3">
    <input class="form-check-input" type="checkbox" name="checkPrepostoEmpresa" id="checkPrepostoEmpresa" {{ old('checkPrepostoEmpresa', $empresa->preposto_id ? true : false) ? 'checked' : '' }}>
    <label class="form-check-label" for="checkPrepostoEmpresa">
        {{ __("Declaro que autorizo esta pessoa a representar minha empresa.") }}
    </label>
</div>

