@extends('layouts.app') @section('content')
{{-- Welcome Section --}}

{{ __('messages.dashboard_messages.welcome_back') }} {{ auth()->user()->name }}!

{{ $userRole }}
@if($userRole === 'customer') {{-- Customer Dashboard --}}

{{ $myShipments }}

{{ __('dashboard_page.my_shipments') }}

{{ $myProducts }}

{{ __('dashboard_page.my_products') }}

{{ $myInvoices }}

{{ __('dashboard_page.my_invoices') }}

Rp {{ number_format($myOutstanding) }}

{{ __('dashboard_page.outstanding_amount') }}

{{-- Recent Shipments Table for Customer --}}

{{ __('dashboard_page.recent_shipments') }}

@forelse($recentShipments as $shipment) @empty @endforelse
{{ __('dashboard_page.tracking_number') }} {{ __('forms.status') }} {{ __('forms.date') }} {{ __('dashboard_page.amount') }}
{{ $shipment->resi_number }} @if($shipment->status == 'Delivered') {{ $shipment->status }} @elseif($shipment->status == 'In Transit') {{ $shipment->status }} @elseif($shipment->status == 'Pending') {{ $shipment->status }} @else {{ $shipment->status }} @endif {{ $shipment->date_received }} Rp {{ number_format($shipment->total_charge) }}
{{ __('dashboard_page.no_recent_shipments') }}
@else {{-- Admin/Owner/Super-admin Dashboard --}} {{-- Include existing summary cards --}} @include('dashboard.partials.summary_cards') @if($userRole === 'super-admin' || $userRole === 'owner') {{-- Include charts and top customers table --}} @include('dashboard.partials.charts') @include('dashboard.partials.top_customers') @endif @if($userRole === 'admin') {{-- Admin specific content --}}

{{ __('dashboard_page.todays_overview') }}

{{ __('dashboard_page.new_shipments') }}

{{ $todayShipments }}

{{ __('dashboard_page.pending') }}

{{ $pendingShipments }}

{{ __('dashboard_page.unpaid_invoices') }}

{{ $unpaidInvoices }}

@endif @endif
@endsection @section('footer') @include('dashboard.partials.fixed-charts') @endsection