<?php
    $profileUser = $user ?? null;
    $modalSuffix = $profileUser?->id ?? 'sem-usuario';
    $fotoPadrao = 'pmar/assets/img/icons/usuario.png';
    $fotoSrc = asset(optional($profileUser)->photo ?? $fotoPadrao);
    $nomeExibicao = $profileUser?->name ?: __('Não informado');
    $lotacao = $profileUser?->pertence
        ? "{$profileUser->pertence->name} ({$profileUser->pertence->abbreviation})"
        : __('Não informada');
?>

<div class="row">

    <div class="col-sm-12 col-md-6 d-flex align-items-start d-flex align-items-center">

        <div class="mb-3">

            <img src="<?php echo e($fotoSrc); ?>"
                 alt="<?php echo e(__('Foto de :nome', ['nome' => $nomeExibicao])); ?>" class="img-fluid rounded-5"
                 style="width: 200px; object-fit: cover; cursor: pointer;"
                 <?php if($profileUser): ?>
                 data-bs-toggle="modal" data-bs-target="#modalFotoPaciente<?php echo e($modalSuffix); ?>"
                 <?php endif; ?> />

            <?php if($profileUser): ?>
            <div class="modal fade" id="modalFotoPaciente<?php echo e($modalSuffix); ?>" tabindex="-1"
                 aria-hidden="true">
                <div class="modal-dialog modal-fullscreen">
                    <div class="modal-content bg-dark">
                        <div class="modal-header border-0">
                            <button type="button" class="btn-close btn-close-white ms-auto"
                                    data-bs-dismiss="modal" aria-label="<?php echo e(__('Fechar')); ?>"></button>
                        </div>
                        <div class="modal-body d-flex justify-content-center align-items-center">
                            <img src="<?php echo e($fotoSrc); ?>"
                                 alt="<?php echo e(__('Foto de :nome', ['nome' => $nomeExibicao])); ?>"
                                 class="img-fluid rounded" style="max-height: 90vh;" />
                        </div>
                    </div>
                </div>
            </div>
            <?php endif; ?>

        </div>


    </div>
    <div class="col-sm-12 col-md-6 d-flex align-items-start d-flex align-items-center">
        <div>
            <?php if(!$profileUser): ?>
            <p class="text-muted mb-0"><?php echo e(__('* Este cadastro não possui usuário vinculado.')); ?></p>
            <?php else: ?>
            <?php echo $__env->make('components.inputs._label',[
            'for' => 'labelNomeCompleto',
            'label' => 'Nome',
            'text' => $nomeExibicao,
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <?php echo $__env->make('components.inputs._label',[
            'for' => 'LabelLotacao',
            'label' => 'Lotação',
            'text' => $lotacao,
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <?php echo $__env->make('components.inputs._label',[
            'for' => 'labelCPF',
            'label' => 'CPF',
            'text' => $profileUser->cpf ?: __('Não informado'),
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <?php if(!empty($profileUser->matriculation)): ?>
            <?php echo $__env->make('components.inputs._label',[
            'for' => 'labelMatricula',
            'label' => 'Matrícula',
            'text' => $profileUser->matriculation,
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
            <?php endif; ?>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php /**PATH /var/www/html/portal/resources/views/components/modal/_modelProfile.blade.php ENDPATH**/ ?>