ifnex/04_Laravel/resources/views/filament/widgets/dashboard-info.blade.php
Kazem Alghasi f61de6f3a5 refactor(ui): redesign admin dashboard widgets and exchange service
Refactor the Filament dashboard by replacing the legacy FinanceOverviewWidget
with a new set of specialized widgets:
- DashboardInfoWidget for general information
- ExchangeRateWidget for real-time rate monitoring
- WalletStats for financial overview

Additionally, refactor the ExchangeRateService to improve encapsulation
and clean up the ExchangeRateHistory model by moving business logic
(change calculation and recording) from the model to the service layer.

Changes include:
- Removing deprecated helper methods from ExchangeRateHistory model
- Implementing direct queries in ExchangeRateService to replace model scopes
- Adding support for rate chart data retrieval
- Reordering and updating widget sorting in AdminPanelProvider
2026-08-10 04:08:29 +03:30

92 lines
5.3 KiB
PHP

<x-filament-widgets::widget>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
{{-- کارت تاریخ و ساعت --}}
<div class="lg:col-span-1 bg-gradient-to-br from-amber-50 to-orange-50 rounded-xl p-6 border border-amber-200 dark:from-gray-800 dark:to-gray-900 dark:border-gray-700">
<div class="flex items-center gap-3 mb-4">
<div class="w-12 h-12 bg-amber-500 rounded-xl flex items-center justify-center text-white">
<x-heroicon-o-calendar-days class="w-6 h-6" />
</div>
<div>
<div class="text-xs text-gray-500 dark:text-gray-400">امروز</div>
<div class="text-sm font-bold text-gray-800 dark:text-white">{{ $time }}</div>
</div>
</div>
<div class="space-y-2">
<div class="flex items-center gap-2">
<span class="text-xs text-gray-500 dark:text-gray-400 w-16">📅 شمسی:</span>
<span class="font-bold text-amber-700 dark:text-amber-400">{{ $jalaliDate }}</span>
</div>
<div class="flex items-center gap-2">
<span class="text-xs text-gray-500 dark:text-gray-400 w-16">🌍 میلادی:</span>
<span class="text-sm text-gray-700 dark:text-gray-300 capitalize">{{ $gregorianDate }}</span>
</div>
</div>
<div class="mt-4 pt-4 border-t border-amber-200 dark:border-gray-700">
<div class="text-xs text-gray-500 dark:text-gray-400">خوش آمدید</div>
<div class="font-bold text-gray-800 dark:text-white">{{ $userName }}</div>
</div>
</div>
{{-- کارت آخرین سفارشات --}}
<div class="lg:col-span-2 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between">
<div class="flex items-center gap-2">
<x-heroicon-o-truck class="w-5 h-5 text-amber-500" />
<h3 class="font-bold text-gray-800 dark:text-white">آخرین سفارشات</h3>
</div>
<a href="{{ route('filament.admin.resources.shipments.index') }}"
class="text-xs text-amber-600 hover:text-amber-700 font-semibold">
مشاهده همه
</a>
</div>
@if($recentShipments->isEmpty())
<div class="p-8 text-center text-gray-500 dark:text-gray-400">
<x-heroicon-o-inbox class="w-12 h-12 mx-auto mb-2 text-gray-300" />
<p>هنوز سفارشی ثبت نشده است</p>
</div>
@else
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead class="bg-gray-50 dark:bg-gray-900 text-gray-600 dark:text-gray-400">
<tr>
<th class="text-right px-4 py-2 font-medium">AWB</th>
<th class="text-right px-4 py-2 font-medium">مسیر</th>
<th class="text-right px-4 py-2 font-medium">وضعیت</th>
<th class="text-right px-4 py-2 font-medium">تاریخ</th>
<th class="text-right px-4 py-2 font-medium">مبلغ</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
@foreach($recentShipments as $shipment)
<tr class="hover:bg-gray-50 dark:hover:bg-gray-900/50">
<td class="px-4 py-3 font-mono text-xs font-semibold text-gray-800 dark:text-white">
{{ $shipment['awb'] }}
</td>
<td class="px-4 py-3 text-gray-700 dark:text-gray-300">
{{ $shipment['route'] }}
</td>
<td class="px-4 py-3">
<span class="inline-block px-2 py-1 rounded-full text-xs font-semibold {{ $shipment['status_color'] }}">
{{ $shipment['status_label'] }}
</span>
</td>
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">
{{ $shipment['date'] }}
</td>
<td class="px-4 py-3 text-xs font-semibold text-gray-700 dark:text-gray-300">
{{ $shipment['amount'] }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
</x-filament-widgets::widget>