TenantAtlas/resources/views/filament/infolists/entries/enterprise-detail/section-items.blade.php
ahmido d4fb886de0 feat: standardize enterprise detail pages (#162)
## Summary
- introduce a shared enterprise-detail composition layer for Filament detail pages
- migrate BackupSet, BaselineSnapshot, EntraGroup, and OperationRun detail screens to the shared summary-first layout
- add regression and unit coverage for section hierarchy, related context, degraded states, and duplicate fact/badge presentation

## Scope
- adds shared support classes under `app/Support/Ui/EnterpriseDetail`
- adds shared enterprise detail Blade partials under `resources/views/filament/infolists/entries/enterprise-detail`
- updates touched Filament resources/pages to use the shared detail shell
- includes Spec 133 artifacts under `specs/133-detail-page-template`

## Notes
- branch: `133-detail-page-template`
- base: `dev`
- commit: `fd294c7`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #162
2026-03-10 23:06:26 +00:00

63 lines
2.6 KiB
PHP

@php
use App\Support\Ui\EnterpriseDetail\FactPresentation;
$items = $items ?? [];
$items = is_array($items) ? array_values(array_filter($items, 'is_array')) : [];
$action = $action ?? null;
$action = is_array($action) ? $action : null;
@endphp
<div class="space-y-4">
<div class="grid gap-3 sm:grid-cols-2">
@foreach ($items as $item)
@php
$displayValue = FactPresentation::value($item);
$badge = is_array($item['badge'] ?? null) ? $item['badge'] : null;
@endphp
<div class="rounded-xl border border-gray-200 bg-gray-50/70 px-4 py-3 dark:border-gray-800 dark:bg-gray-950/30">
<div class="text-xs font-semibold uppercase tracking-[0.16em] text-gray-500 dark:text-gray-400">
{{ $item['label'] ?? 'Detail' }}
</div>
<div class="mt-2 flex flex-wrap items-center gap-2 text-sm font-medium text-gray-900 dark:text-white">
@if ($displayValue !== null)
<span>{{ $displayValue }}</span>
@endif
@if ($badge !== null)
<x-filament::badge
:color="$badge['color'] ?? 'gray'"
:icon="$badge['icon'] ?? null"
:icon-color="$badge['iconColor'] ?? null"
size="sm"
>
{{ $badge['label'] ?? 'State' }}
</x-filament::badge>
@endif
</div>
@if (filled($item['hint'] ?? null))
<div class="mt-1 text-xs text-gray-500 dark:text-gray-400">
{{ $item['hint'] }}
</div>
@endif
</div>
@endforeach
</div>
@if ($action !== null && filled($action['url'] ?? null))
<div>
<a
href="{{ $action['url'] }}"
@if (($action['openInNewTab'] ?? false) === true) target="_blank" rel="noreferrer noopener" @endif
class="inline-flex items-center gap-2 text-sm font-medium {{ ($action['destructive'] ?? false) === true ? 'text-rose-700 hover:text-rose-600 dark:text-rose-200 dark:hover:text-rose-100' : 'text-primary-600 hover:text-primary-500 dark:text-primary-400 dark:hover:text-primary-300' }}"
>
@if (filled($action['icon'] ?? null))
<x-filament::icon :icon="$action['icon']" class="h-4 w-4" />
@endif
{{ $action['label'] }}
</a>
</div>
@endif
</div>