

<?php $__env->startSection('content'); ?>
<main class="main-content">
    <header class="header mobile-header">
        <div class="user-greeting">
            <h3>Tagihan Air</h3>
        </div>
    </header>

    
    <h4>Tagihan Bulan Ini</h4>
    <?php if($currentInvoice): ?>
        <div class="bill-card">
            <div class="bill-header">
                <i class="fas fa-file-alt"></i>
                <h4>Tagihan Bulan Ini</h4>
            </div>
            <div class="bill-amount">
                <h2>Rp <?php echo e(number_format($currentInvoice->total_amount, 0, ',', '.')); ?></h2>
                <p>Jatuh Tempo: <?php echo e($currentInvoice->due_date->translatedFormat('d F Y')); ?></p>
            </div>
            <button class="bill-card-btn" onclick="window.location.href='<?php echo e(route('invoices.show', $currentInvoice->id)); ?>'">
            Bayar Sekarang
            </button>
        </div>
    <?php else: ?>
    <div class="empty-state-card">
        <div class="empty-state-icon">
            
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
            </svg>
        </div>
        
        <h4>Semua Tagihan Lunas!</h4>
        <p>Anda tidak memiliki tagihan aktif untuk bulan ini. Nikmati harimu!</p>
        
    </div>
    <?php endif; ?>

    
    <h4 style="margin-top: 30px;">Riwayat Tagihan</h4>
    <div class="history-list">
        <?php $__empty_1 = true; $__currentLoopData = $invoiceHistory; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <a href="<?php echo e(route('invoices.show', $invoice->id)); ?>" class="history-item-link">
            <div class="history-item">
            <div class="history-icon">
                <i class="fas fa-check-circle"></i>
            </div>
            <div class="history-details">
                <h5>
                Tagihan 
                <?php if($invoice->created_at): ?>
                    <?php echo e($invoice->created_at->translatedFormat('F Y')); ?>

                <?php elseif($invoice->due_date): ?>
                    <?php echo e($invoice->due_date->translatedFormat('F Y')); ?>

                <?php else: ?>
                    #<?php echo e($invoice->id); ?>

                <?php endif; ?>
            </h5>
                <p>
                Lunas pada 
                <?php if($invoice->paid_at): ?>
                    <?php echo e($invoice->paid_at->translatedFormat('d M Y, H:i')); ?>

                <?php else: ?>
                    -
                <?php endif; ?>
            </p>
            </div>
            <div class="history-amount">
                <strong>Rp <?php echo e(number_format($invoice->total_amount, 0, ',', '.')); ?></strong>
            </div>
        </div>
    </a>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="invoice-card empty">
                <p>Belum ada riwayat tagihan.</p>
            </div>
        <?php endif; ?>
    </div>

    
    <div class="pagination-links">
        <?php echo e($invoiceHistory->links()); ?>

    </div>

</main>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\UsEr\Documents\0 Mata Kuliah\Tugas Akhir\Project Pamsimas\PAMSIMAS_User\resources\views/invoices/index.blade.php ENDPATH**/ ?>