Files
WMS/Modules/Countries/Resources/views/show.blade.php
T

73 lines
5.1 KiB
PHP

<x-layouts.app>
<div class="mx-auto max-w-[1200px] space-y-6" dusk="countries-show">
<div class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-6 py-7 text-white">
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-blue-200">ISO 3166 country</p>
<h1 class="mt-2 text-3xl font-semibold tracking-tight">{{ $country->flag_emoji }} {{ $country->effective_name }}</h1>
<p class="mt-2 max-w-3xl text-sm text-blue-100/90">{{ $country->official_name ?: $country->name }}</p>
<div class="mt-4 flex gap-2">
<a href="{{ route('countries.edit', $country) }}" wire:navigate class="rounded-xl bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-blue-700">Edit support</a>
<a href="{{ route('countries.index') }}" wire:navigate class="rounded-xl bg-white/10 px-4 py-2.5 text-sm font-semibold text-white ring-1 ring-white/20 hover:bg-white/20">Back</a>
</div>
</div>
</div>
@if (session('success'))
<div class="rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm font-medium text-emerald-800 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-200">{{ session('success') }}</div>
@endif
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
@foreach ([
'Alpha-2' => $country->alpha2,
'Alpha-3' => $country->alpha3,
'Numeric' => $country->numeric,
'Canonical name' => $country->name,
'Official name' => $country->official_name ?: '—',
'Common name' => $country->common_name ?: '—',
'Display override' => $country->display_name ?: '—',
'ISO status' => str($country->iso_status ?? 'official')->replace('_', ' ')->title(),
'Region' => $country->region ?: '—',
'Subregion' => $country->subregion ?: '—',
'Independent' => is_null($country->independent) ? '—' : ($country->independent ? 'Yes' : 'No'),
'Active' => $country->is_active ? 'Yes' : 'No',
] as $label => $value)
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="text-xs font-bold uppercase tracking-wide text-zinc-500">{{ $label }}</div>
<div class="mt-2 text-base font-semibold text-zinc-900 dark:text-zinc-100">{{ $value }}</div>
</div>
@endforeach
</div>
<div class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="border-b border-zinc-200 px-5 py-4 dark:border-zinc-800">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">ISO 3166-2 subdivisions</h2>
<p class="text-xs text-zinc-500">Subdivisions are stored separately for address, compliance and shipping workflows.</p>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 dark:divide-zinc-800">
<thead class="bg-zinc-50 dark:bg-zinc-950">
<tr>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Code</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Name</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Type</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($country->subdivisions()->ordered()->limit(100)->get() as $subdivision)
<tr>
<td class="px-4 py-3 font-mono text-sm text-blue-700 dark:text-blue-300">{{ $subdivision->code }}</td>
<td class="px-4 py-3 text-sm font-semibold text-zinc-900 dark:text-zinc-100">{{ $subdivision->name }}</td>
<td class="px-4 py-3 text-sm text-zinc-500">{{ $subdivision->type ?: '—' }}</td>
<td class="px-4 py-3 text-sm text-zinc-500">{{ str($subdivision->iso_status)->replace('_', ' ')->title() }}</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-8 text-center text-sm text-zinc-500">No subdivisions have been imported for this country yet.</td></tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</x-layouts.app>