parfum/resources/views/components/sections/ui/audit.blade.php

73 lines
3.5 KiB
PHP

<flux:main>
<div class="flex justify-between items-center">
<div>
<flux:heading size="xl">{{ $pageTitle }}</flux:heading>
</div>
<div>
<flux:button href="{{ $backRoute }}" wire:navigate class="text-sm">
Kembali
</flux:button>
</div>
</div>
<div class="mt-6 space-y-4">
@forelse ($activityLogs as $log)
<flux:card class="p-4 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition text-gray-500 dark:text-gray-300">
<div class="flex justify-between items-center mb-2">
<div class="text-md font-semibold text-zinc-800 dark:text-zinc-100">{{ $log->log_name }}</div>
<div class="text-xs">{{ formatDateLocalized($log->created_at) }}</div>
</div>
<div class="flex justify-between items-center mb-2">
<div class="text-sm">
<span
class="font-medium">{{ $log->properties['location_name'] ?? 'Lokasi Tidak Diketahui' }}</span>
<span class="text-xs opacity-70">({{ ucfirst($log->properties['location_type'] ?? '') }})</span>
</div>
<span
class="px-2 py-0.5 inline-flex text-xs font-semibold rounded-full {{ $log->event['classes'] }}">
{{ $log->event['label'] }}
</span>
</div>
<flux:separator class="my-2 dark:border-gray-700" />
<div class="flex flex-wrap gap-4 text-sm ">
<div>Awal: <span
class="font-medium text-zinc-700 dark:text-zinc-200">{{ formatCurrencyNumber($log->properties['previous_stock'] ?? 0) }}</span>
</div>
<flux:separator vertical class="hidden sm:block dark:border-gray-700" />
<div>Perubahan: <span
class="font-medium {{ ($log->properties['quantity_change'] ?? 0) >= 0 ? 'text-emerald-600' : 'text-orange-600' }}">{{ ($log->properties['quantity_change'] ?? 0) >= 0 ? '+' : '' }}{{ formatCurrencyNumber($log->properties['quantity_change'] ?? 0) }}</span>
</div>
<flux:separator vertical class="hidden sm:block dark:border-gray-700" />
<div>Akhir: <span
class="font-medium text-zinc-700 dark:text-zinc-200">{{ formatCurrencyNumber($log->properties['new_stock'] ?? 0) }}</span>
</div>
</div>
<flux:separator class="my-2 dark:border-gray-700" />
<div class="flex items-center gap-2 mt-2">
<flux:icon name="user" size="sm" class="opacity-50" />
<p class="text-xs">
{{ $log->causer?->employee?->full_name ?? ($log->causer?->name ?? 'System') }}
</p>
</div>
<p class="mt-2 text-sm text-zinc-600 dark:text-zinc-400 italic">
"{{ $log->description }}"
</p>
</flux:card>
@empty
@include('components.animations.lottie.boxing-cat', [
'message' => 'Belum ada riwayat tercatat untuk barang ini. 🐱'
])
@endforelse
</div>
</flux:main>
@assets
<script src="https://unpkg.com/@lottiefiles/dotlottie-wc@0.8.5/dist/dotlottie-wc.js" type="module"></script>
@endassets