@extends('root') @section('title', 'Paket Langganan') @push('styles') @endpush @section('content')
@include('components.breadcrumb', [ 'title' => 'Paket Langganan', 'links' => [ ['url' => route('client.dashboard'), 'label' => 'Dashboard'], ], 'current' => 'Paket' ]) {{-- Hero Section --}}
@if($activePackage)
@php $effectivePackage = $activePackage->effective_package; @endphp @if($effectivePackage) {{ method_exists($effectivePackage, 'getTypeLabelAttribute') ? $effectivePackage->getTypeLabelAttribute() : ($effectivePackage->type ?? 'Custom') }} Package @endif @else Legacy Mode @endif
@if($activePackage) @php $effectivePackage = $activePackage->effective_package; @endphp

{{ $effectivePackage?->name }}

@if($activePackage->remaining_days !== null) Berakhir dalam {{ $activePackage->remaining_days }} hari ({{ $activePackage->end_at->format('d M Y') }}) @else Permanen / Unlimited @endif

Limit Agent @php $agentLimit = $client->getAgentLimit(); @endphp {{ $agentLimit === -1 ? 'Unlimited' : $agentLimit . ' Agent' }}
@else

Mode Legacy

Anda memiliki akses unlimited ke semua fitur

@endif
Saldo Anda

Rp {{ number_format($client->balance, 0, ',', '.') }}

Top Up Saldo
{{-- Next Package Info --}} @if($activePackage && $activePackage->next_package_id)
Dijadwalkan: Paket {{ $activePackage->nextPackage->name }} akan aktif setelah paket saat ini berakhir.
@endif {{-- Billing Toggle --}}
{{-- Available Packages --}}
@foreach($availablePackages as $package) {{-- Skip shared packages from purchase list --}} @continue($package->isShared())
{{ strtoupper($package->getTypeLabelAttribute()) }}

{{ $package->name }}

{{-- Dynamic Price Display --}}
Rp {{ number_format($package->price_monthly, 0, ',', '.') }} / bulan
Rp {{ number_format($package->price_yearly, 0, ',', '.') }} / tahun
@if($package->description)

{{ $package->description }}

@endif {{-- Agent Limit Highlight --}}
Kapasitas Agent
{{ $package->max_agent }} Agent
    @php $features = $package->features->where('is_enabled', true); @endphp @foreach($features->take(5) as $feature)
  • {{ \App\Models\PackageFeature::getFeatureName($feature->feature_code) }}
  • @endforeach
@if($activePackage && $activePackage->package_id === $package->id) @else @endif
@endforeach
{{-- Purchase Modal --}} @endsection @push('scripts') @endpush