
<?php $__env->startSection('content'); ?>
    <div class="page-container">

        <div class="page-title-head d-flex align-items-sm-center flex-sm-row flex-column gap-2">
            <div class="flex-grow-1">
                <h4 class="fs-18 fw-semibold mb-0"><?php echo e($title); ?></h4>
            </div>

            <div class="text-end">
                <?php echo $__env->make('dashboard.user.layouts.components.breadcrumbs', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            </div>
        </div>

        <div class="row">
            <?php echo $__env->make('dashboard.user.components.menu', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <dl class="row">
                            <dt class="col-sm-3">Amount</dt>
                            <dd class="col-sm-9"><?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loan->amount)); ?></dd>

                            <dt class="col-sm-3">Status</dt>
                            <dd class="col-sm-9">
                                <span class="<?php echo e($loan->status->badge()); ?>">
                                    <?php echo e($loan->status->label()); ?>

                                </span>
                            </dd>

                            <dt class="col-sm-3">Total Repayable</dt>
                            <dd class="col-sm-9">
                                <?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loan->total_repayable)); ?>

                            </dd>

                            <dt class="col-sm-3">Disbursed At</dt>
                            <dd class="col-sm-9"><?php echo e($loan->disbursed_at ? $loan->disbursed_at->format('d M Y') : 'N/A'); ?>

                            </dd>

                            <dt class="col-sm-3">Due At</dt>
                            <dd class="col-sm-9"><?php echo e($loan->due_at ? $loan->due_at->format('d M Y') : 'N/A'); ?></dd>

                            <?php if($loan->loanRepayments): ?>
                                <?php $__currentLoopData = $loan->loanRepayments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loanRepayment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <dt class="col-sm-3">Loan Repayment Status</dt>
                                    <dd class="col-sm-9">
                                        Amount:
                                        <?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loanRepayment->amount)); ?><br>
                                        Status: <?php echo $loanRepayment->status->badge(); ?><br>
                                        Repaid At:
                                        <?php echo e($loanRepayment->repaid_at ? $loanRepayment->repaid_at->format('d M Y') : 'N/A'); ?>

                                    </dd>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                        </dl>
                        <?php if($loan->status->value === 'active'): ?>
                            <a href="<?php echo e(route('user.loan.repay', $loan->uuid)); ?>" class="btn btn-primary">Repay Full Amount
                                (<?php echo e(currency($loan->user->currency)); ?><?php echo e(formatAmount($loanRepayment->amount)); ?>)</a>
                        <?php endif; ?>

                        <div class="d-flex justify-content-end">
                            <a href="<?php echo e(route('user.loan.index')); ?>" class="btn btn-primary">Back</a>
                        </div>

                    </div><!-- end card-body -->
                </div><!-- end card -->
            </div>

        </div>

    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.user.layouts.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projects\online-banking-v6.0\resources\views/dashboard/user/loan/show.blade.php ENDPATH**/ ?>