@extends('layouts.front.home') @section('title') {{ __('nav.home') }} - {{ __('nav.dashboard') }} @endsection @section('css') @endsection @section('content') @php $isAr = app()->getLocale() === 'ar'; @endphp
@include('flash::message')

{{ __('nav.welcome') }}

{{ __('nav.dashboard_description') }}

{{ __('nav.recent_orders') }}
{{ __('nav.view_all') }}
@forelse($recentOrders as $order) @php $statusState = $order->front_status_state ?? ['text' => ($isAr ? 'قيد الانتظار' : 'Pending'), 'class' => 'vd-chip-pending', 'filter_key' => 'pending']; $statusFilterKey = $statusState['filter_key'] ?? $statusState['key'] ?? 'pending'; $statusChipClass = $statusState['class'] ?? 'vd-chip-pending'; if (str_starts_with($statusChipClass, 'chip-')) { $statusChipClass = 'vd-chip-' . substr($statusChipClass, 5); } $typeLabels = [ 1 => __('nav.purchase'), 2 => __('nav.quotation'), 3 => __('nav.maintenance'), ]; $orderTypeLabel = $typeLabels[(int)($order->order_type ?? 0)] ?? __('nav.order'); $filterUrl = route('vendor/orders', ['tab' => 'all', 'status' => $statusFilterKey]); @endphp

{{ $orderTypeLabel }} #{{ $order->id }}

{{ $order->user->name ?? '-' }}

{{ $statusState['text'] ?? ($isAr ? 'قيد الانتظار' : 'Pending') }}
{{ number_format((float)($order->total_cost ?? 0), 2) }} SAR
@empty
{{ __('nav.no_orders') }}
@endforelse
{{ __('nav.important_notifications') }}
{{ __('nav.view_all') }}
@forelse($recentNotifications as $n)

{{ $n->title ?? __('nav.alert') }}

{{ \Illuminate\Support\Str::limit($n->message ?? $n->content, 60) }}

@empty
{{ __('nav.no_important_notifications') }}
@endforelse
@include('front.partials.order-workflow-hint', ['role' => 'vendor'])
@endsection