{{-- Mobile Services Overview Partial Shows available services with status and quick actions Expects: $user (Auth::user()) --}} @php // Get user's latest applications/requests $latestLoan = Auth::user()->user_plans()->latest()->first(); $latestGrant = Auth::user()->grantApplications()->latest()->first(); $latestTaxRefund = Auth::user()->irsRefunds()->latest()->first(); $userCards = Auth::user()->cards()->where('status', 'active')->latest()->first(); $services = [ [ 'name' => 'Loans', 'icon' => 'fa-solid fa-landmark', 'color' => 'from-blue-500 to-blue-600', 'bg_color' => 'bg-blue-100 dark:bg-blue-900/30', 'text_color' => 'text-blue-600 dark:text-blue-400', 'route' => route('loan'), 'status' => $latestLoan ? ucfirst($latestLoan->active) : 'Available', 'status_color' => $latestLoan ? ($latestLoan->active == 'Pending' ? 'text-yellow-600' : ($latestLoan->active == 'Active' ? 'text-green-600' : 'text-gray-600')) : 'text-gray-500', 'description' => $latestLoan ? 'Amount: ' . Auth::user()->s_curr . number_format($latestLoan->amount ?? 0, 2) : 'Quick approval process', 'action' => $latestLoan ? 'View Details' : 'Apply Now' ], [ 'name' => 'Grants', 'icon' => 'fa-solid fa-hand-holding-dollar', 'color' => 'from-green-500 to-emerald-600', 'bg_color' => 'bg-green-100 dark:bg-green-900/30', 'text_color' => 'text-green-600 dark:text-green-400', 'route' => route('grant.index'), 'status' => $latestGrant ? ucfirst($latestGrant->status) : 'Available', 'status_color' => $latestGrant ? ($latestGrant->status == 'processing' ? 'text-yellow-600' : ($latestGrant->status == 'approved' ? 'text-green-600' : ($latestGrant->status == 'disbursed' ? 'text-blue-600' : 'text-red-600'))) : 'text-gray-500', 'description' => $latestGrant ? 'Amount: ' . Auth::user()->s_curr . number_format($latestGrant->requested_amount ?? 0, 2) : 'No repayment required', 'action' => $latestGrant ? 'View Status' : 'Apply Now' ], [ 'name' => 'Tax Refunds', 'icon' => 'fa-solid fa-receipt', 'color' => 'from-purple-500 to-purple-600', 'bg_color' => 'bg-purple-100 dark:bg-purple-900/30', 'text_color' => 'text-purple-600 dark:text-purple-400', 'route' => route('irs-refund'), 'status' => $latestTaxRefund ? ucfirst($latestTaxRefund->status) : 'Available', 'status_color' => $latestTaxRefund ? ($latestTaxRefund->status == 'pending' ? 'text-yellow-600' : ($latestTaxRefund->status == 'approved' ? 'text-green-600' : 'text-red-600')) : 'text-gray-500', 'description' => $latestTaxRefund ? 'Filing ID: ' . ($latestTaxRefund->filing_id ? 'Submitted' : 'Required') : 'Fast processing', 'action' => $latestTaxRefund ? 'Track Status' : 'Apply Now' ], [ 'name' => 'Virtual Cards', 'icon' => 'fa-solid fa-credit-card', 'color' => 'from-orange-500 to-red-600', 'bg_color' => 'bg-orange-100 dark:bg-orange-900/30', 'text_color' => 'text-orange-600 dark:text-orange-400', 'route' => route('cards'), 'status' => $userCards ? ucfirst($userCards->status) : 'Available', 'status_color' => $userCards ? ($userCards->status == 'active' ? 'text-green-600' : ($userCards->status == 'pending' ? 'text-yellow-600' : 'text-gray-600')) : 'text-gray-500', 'description' => $userCards ? 'Card ending in •••• ' . ($userCards->last_four ?? ($userCards->card_number ? substr($userCards->card_number, -4) : '****')) : 'Instant virtual cards', 'action' => $userCards ? 'Manage Cards' : 'Apply Now' ] ]; @endphp
{{ $service['description'] }}
{{ $service['action'] }}