@extends('layouts.admin.theme')
@section("title", env("APP_NAME") . " :: Página de Acompanhamento - Paciente com Fibromialgia - Dados do Usuário")
@section('content')

<div class="card shadow">

    @php $headLine = "<i class='fa-solid fa-user-injured'></i> Página de Acompanhamento - Paciente com Fibromialgia - Dados do Usuário"; @endphp

    @include('components.buttons._headLineButtonsBackAdd', [
    'headLine' => __($headLine),
    "permission" => "GERENCIADOR_DE_CONTA_ANGRA",
    ])

    <div class="card-body">
        <form action="{{ route("admin.saude.fibromialgia.perfil.dadosUsuarioUpdate", [$paciente->id, $user->id]) }}" method="post" enctype="multipart/form-data">

            @include("errors.messageFlash")
            @include('components.modal._modelProfile')
            @csrf
            @method('post')

            <div class="tab-content">

                <hr/>
                <div class="row">
                    <div class="col-sm-12 col-md-6">
                        <!-- Campo Nome completo -->
                        @include('components.inputs._inputType',[
                        "for" => null,
                        "label" => "Nome completo",
                        "name" => "fullName",
                        "id" => null,
                        "required" => true,
                        "type" => null,
                        "old" => old('fullName', $user->name),
                        "oninput" => "javascript:this.value = this.value.toLocaleUpperCase('pt-BR').replace(/[^\p{L}\s]+/gu, '').replace(/\s{2,}/g,' ').trimStart()",
                        "readonly" => false,
                        "small" => null,
                        ])
                    </div>
                    <div class="col-sm-12 col-md-6">
                        <div style="width: 100%">
                            <!-- Campo Foto -->
                            @include('components.inputs._inputType',[
                            "for" => null,
                            "label" => "Foto",
                            "name" => "photo",
                            "id" => null,
                            "required" => false,
                            "type" => 'file',
                            "old" => null,
                            "oninput" => null,
                            "readonly" => true,
                            "small" => null,
                            "accept" => 'image/jpeg,image/jpg,image/png,image/gif',
                            ])
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-12 col-md-4">
                        <!-- Campo Telefone -->
                        @include('components.inputs._inputType',[
                        "for" => null,
                        "label" => "Telefone",
                        "name" => "phoneNumber",
                        "id" => null,
                        "required" => true,
                        "type" => null,
                        "old" => old('phoneNumber', $user->phoneNumber),
                        "oninput" => "javascript:aplicarMascaraTelefone(this)",
                        "readonly" => false,
                        "small" => null,
                        ])
                    </div>
                    <div class="col-sm-12 col-md-4 d-flex align-items-center">
                        @include("components.inputs._checkBoxIsWhatsapp", ["isWhatsapp" => $user->isWhatsapp])
                    </div>
                    <div class="col-sm-12 col-md-4">
                        <!-- Campo Email -->
                        @include('components.inputs._inputType',[
                        "for" => null,
                        "label" => "Email",
                        "name" => "email",
                        "id" => null,
                        "required" => false,
                        "type" => 'email',
                        "old" => old('email', $user->email),
                        "oninput" => "javascript:this.value = this.value.toLowerCase()",
                        "readonly" => false,
                        "small" => null,
                        "placeholder" => "nome@email.com",
                        ])
                    </div>
                </div>

                <div class="row">
                    <div class="d-flex justify-content-between mt-4">
                        <a class="btn btn-outline-secondary" href="{{ route("admin.saude.fibromialgia.perfil.show", $paciente->id) }}">
                            <i class="fa-solid fa-arrow-left-long"></i> {{ __("Voltar") }}
                        </a>
                        <button class="btn btn-primary d-inline" type="submit">
                            <i class="fa-solid fa-user-plus"></i> {{ __("Salvar") }}
                        </button>
                    </div>
                </div>
            </div>
        </form>

    </div>
</div>

@endsection