253 lines
15 KiB
PHP
253 lines
15 KiB
PHP
<x-filament-panels::page>
|
|
<div class="flex flex-wrap gap-2">
|
|
@foreach ($this->getFilters as $filter)
|
|
<button wire:click="setFilter('{{ $filter['id'] }}')" @class([
|
|
'inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200',
|
|
"bg-{$filter['color']}-500 text-white shadow-md shadow-{$filter['color']}-500/20" =>
|
|
$filterStatus === $filter['id'],
|
|
'bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700' =>
|
|
$filterStatus !== $filter['id'],
|
|
])>
|
|
@if ($filter['icon'])
|
|
<x-dynamic-component :component="$filter['icon']" class="w-4 h-4" />
|
|
@endif
|
|
<span>{{ $filter['label'] }}</span>
|
|
<span @class([
|
|
'px-2 py-0.5 text-xs rounded-full',
|
|
'bg-white/20' => $filterStatus === $filter['id'],
|
|
"bg-{$filter['color']}-100 text-{$filter['color']}-700 dark:bg-{$filter['color']}-500/20 dark:text-{$filter['color']}-400" =>
|
|
$filterStatus !== $filter['id'],
|
|
])>{{ $filter['count'] ?? 0 }}</span>
|
|
</button>
|
|
@endforeach
|
|
</div>
|
|
|
|
{{-- Verification Cards Grid --}}
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
|
@forelse ($this->verifications as $verification)
|
|
<x-filament::section class="h-full">
|
|
<x-slot name="heading">
|
|
<div class="flex items-start justify-between gap-3">
|
|
<div class="min-w-0 flex-1">
|
|
<h3 class="font-bold text-lg text-gray-900 dark:text-white truncate"
|
|
title="{{ $verification['company']['name'] }}">
|
|
{{ $verification['company']['name'] }}
|
|
</h3>
|
|
</div>
|
|
|
|
{{-- Status Badge --}}
|
|
<x-filament::badge :color="$verification['status']['color']" size="lg">
|
|
{{ $verification['status']['label'] }}
|
|
</x-filament::badge>
|
|
</div>
|
|
</x-slot>
|
|
|
|
<div class="space-y-4">
|
|
{{-- Submitter Info --}}
|
|
<div class="flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg">
|
|
<div class="shrink-0">
|
|
<div
|
|
class="w-10 h-10 rounded-full bg-primary-100 dark:bg-primary-500/20 flex items-center justify-center">
|
|
<x-heroicon-s-user class="w-5 h-5 text-primary-500" />
|
|
</div>
|
|
</div>
|
|
<div class="min-w-0 flex-1">
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase font-semibold">Diajukan oleh
|
|
</p>
|
|
<p class="text-sm font-medium text-gray-900 dark:text-white truncate">
|
|
{{ $verification['submittedBy'] }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Data Summary --}}
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg">
|
|
{{-- Company Summary --}}
|
|
<div>
|
|
<div class="flex items-center gap-2 mb-1">
|
|
<x-heroicon-o-building-office-2 class="w-4 h-4 text-primary-500" />
|
|
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase">Perusahaan
|
|
</p>
|
|
</div>
|
|
<p class="text-sm font-medium text-gray-900 dark:text-white truncate">
|
|
{{ $verification['summary']['company']['name'] }}
|
|
</p>
|
|
<x-filament::badge :color="$verification['summary']['company']['exists'] ? 'success' : 'warning'" size="xs" class="mt-1">
|
|
{{ $verification['summary']['company']['exists'] ? '✓ Lengkap' : '⚠ Belum diisi' }}
|
|
</x-filament::badge>
|
|
</div>
|
|
|
|
{{-- Media Summary --}}
|
|
<div>
|
|
<div class="flex items-center gap-2 mb-1">
|
|
<x-heroicon-o-newspaper class="w-4 h-4 text-info-500" />
|
|
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase">Media</p>
|
|
</div>
|
|
<p class="text-sm font-medium text-gray-900 dark:text-white truncate">
|
|
{{ $verification['summary']['media']['name'] }}
|
|
</p>
|
|
<x-filament::badge :color="$verification['summary']['media']['exists'] ? 'success' : 'warning'" size="xs" class="mt-1">
|
|
{{ $verification['summary']['media']['exists'] ? '✓ Lengkap' : '⚠ Belum diisi' }}
|
|
</x-filament::badge>
|
|
</div>
|
|
|
|
{{-- Journalists Summary --}}
|
|
<div>
|
|
<div class="flex items-center gap-2 mb-1">
|
|
<x-heroicon-o-identification class="w-4 h-4 text-info-500" />
|
|
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase">Jurnalis</p>
|
|
</div>
|
|
<p class="text-sm font-medium text-gray-900 dark:text-white">
|
|
{{ $verification['summary']['journalists']['count'] }} jurnalis
|
|
</p>
|
|
<x-filament::badge :color="$verification['summary']['journalists']['exists'] ? 'success' : 'warning'" size="xs" class="mt-1">
|
|
{{ $verification['summary']['journalists']['exists'] ? '✓ Lengkap' : '⚠ Belum diisi' }}
|
|
</x-filament::badge>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Timeline Info --}}
|
|
<div class="grid grid-cols-2 gap-3 text-sm">
|
|
<div>
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase font-semibold">Diajukan</p>
|
|
<p class="text-gray-700 dark:text-gray-300">
|
|
{{ $verification['timestamps']['submittedAt'] }}
|
|
</p>
|
|
<p class="text-xs text-gray-500">
|
|
{{ $verification['timestamps']['submittedAtHuman'] }}
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase font-semibold">Pembaruan
|
|
Terakhir
|
|
</p>
|
|
<p class="text-gray-700 dark:text-gray-300">
|
|
{{ $verification['timestamps']['updatedAt'] }}
|
|
</p>
|
|
<p class="text-xs text-gray-500">
|
|
{{ $verification['timestamps']['updatedAtHuman'] }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Latest Review Note --}}
|
|
@if ($verification['reviews']['latest']['note'])
|
|
<div class="p-3 rounded-lg border {{ $verification['reviews']['latest']['classes'] }}">
|
|
<p
|
|
class="text-xs font-semibold uppercase mb-1 {{ $verification['reviews']['latest']['titleClasses'] }}">
|
|
Catatan Terakhir
|
|
</p>
|
|
<p class="text-sm text-gray-700 dark:text-gray-300 line-clamp-2">
|
|
{{ $verification['reviews']['latest']['note'] }}
|
|
</p>
|
|
<p class="text-xs text-gray-500 mt-1">
|
|
oleh {{ $verification['reviews']['latest']['reviewer'] }} •
|
|
{{ $verification['reviews']['latest']['createdAtHuman'] }}
|
|
</p>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Review History Accordion --}}
|
|
@if ($verification['reviews']['count'] > 0)
|
|
<div x-data="{ open: false }"
|
|
class="border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden">
|
|
<button @click="open = !open"
|
|
class="w-full flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors">
|
|
<div
|
|
class="flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
<x-heroicon-o-clock class="w-4 h-4" />
|
|
Riwayat Review ({{ $verification['reviews']['count'] }})
|
|
</div>
|
|
<x-heroicon-o-chevron-down
|
|
class="w-4 h-4 text-gray-500 transition-transform duration-200"
|
|
x-bind:class="{ 'rotate-180': open }" />
|
|
</button>
|
|
|
|
<div x-show="open" x-collapse class="border-t border-gray-200 dark:border-gray-700">
|
|
<div class="divide-y divide-gray-100 dark:divide-gray-700 max-h-60 overflow-y-auto">
|
|
@foreach ($verification['reviews']['history'] as $review)
|
|
<div class="p-3">
|
|
<div class="flex items-start justify-between gap-3">
|
|
<div class="flex-1 min-w-0">
|
|
<div class="flex items-center gap-2 mb-1">
|
|
<x-filament::badge :color="$review['decisionColor']" size="sm">
|
|
{{ $review['decisionLabel'] }}
|
|
</x-filament::badge>
|
|
<span class="text-xs text-gray-500 dark:text-gray-400">
|
|
oleh {{ $review['reviewerName'] }}
|
|
</span>
|
|
</div>
|
|
@if ($review['note'])
|
|
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">
|
|
{{ $review['note'] }}
|
|
</p>
|
|
@endif
|
|
</div>
|
|
<div class="shrink-0 text-xs text-gray-400">
|
|
{{ $review['createdAt'] }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<x-slot name="footer">
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
{{-- View Detail Button --}}
|
|
@if ($verification['company']['detailUrl'])
|
|
<x-filament::button color="gray" size="sm" icon="heroicon-m-eye" tag="a"
|
|
:href="$verification['company']['detailUrl']">
|
|
Detail
|
|
</x-filament::button>
|
|
@endif
|
|
|
|
{{-- Action Buttons based on status --}}
|
|
@if ($verification['status']['isPending'])
|
|
{{ ($this->approveAction)(['id' => $verification['id']]) }}
|
|
{{ ($this->revisionAction)(['id' => $verification['id']]) }}
|
|
{{ ($this->rejectAction)(['id' => $verification['id']]) }}
|
|
@elseif($verification['status']['isRevision'])
|
|
<span
|
|
class="flex items-center gap-1 text-xs text-warning-600 dark:text-warning-400 font-medium italic">
|
|
<x-heroicon-s-clock class="w-3 h-3 animate-pulse" />
|
|
Menunggu revisi dari pengguna...
|
|
</span>
|
|
@elseif($verification['status']['isApproved'])
|
|
<span
|
|
class="flex items-center gap-1 text-xs text-success-600 dark:text-success-400 font-medium">
|
|
<x-heroicon-s-check-circle class="w-3 h-3" />
|
|
Verifikasi selesai
|
|
</span>
|
|
@elseif($verification['status']['isRejected'])
|
|
<span
|
|
class="flex items-center gap-1 text-xs text-danger-600 dark:text-danger-400 font-medium">
|
|
<x-heroicon-s-x-circle class="w-3 h-3" />
|
|
Pengajuan ditolak
|
|
</span>
|
|
@endif
|
|
</div>
|
|
</x-slot>
|
|
</x-filament::section>
|
|
@empty
|
|
<div class="col-span-full">
|
|
<x-filament::empty-state icon="heroicon-o-inbox" heading="Tidak ada pengajuan verifikasi"
|
|
description="Belum ada pengajuan verifikasi dari user." iconColor="gray">
|
|
</x-filament::empty-state>
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
|
|
{{-- Infinite Scroll Sentinel --}}
|
|
@if ($this->verifications->hasMorePages())
|
|
<div x-intersect="$wire.loadMore()" class="py-6 flex justify-center">
|
|
<x-filament::loading-indicator class="w-8 h-8 text-primary-500" />
|
|
</div>
|
|
@endif
|
|
|
|
<x-filament-actions::modals />
|
|
</x-filament-panels::page>
|