43 lines
1.9 KiB
PHP
43 lines
1.9 KiB
PHP
@php
|
|
$title = $title ?? ($pageTitle ?? '');
|
|
$subtitle = $subtitle ?? ($pageSubtitle ?? '');
|
|
$actions = $actions ?? ($pageActions ?? []);
|
|
$stats = $stats ?? [];
|
|
@endphp
|
|
<div class="page-header bg-white rounded-lg shadow-sm border border-gray-200 p-6 mb-6">
|
|
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between">
|
|
<div class="mb-4 lg:mb-0">
|
|
@if(!empty($title))
|
|
<h1 class="text-xl font-semibold text-gray-800">{{ $title }}</h1>
|
|
@endif
|
|
@if(!empty($subtitle))
|
|
<p class="text-gray-500">{{ $subtitle }}</p>
|
|
@endif
|
|
</div>
|
|
@if(!empty($actions))
|
|
<div class="flex flex-wrap gap-2">
|
|
@foreach($actions as $action)
|
|
<a href="{{ $action['url'] ?? '#' }}"
|
|
class="btn btn-sm {{ ($action['type'] ?? 'secondary') === 'primary' ? 'btn-primary' : 'btn-outline-secondary' }}">
|
|
@if(!empty($action['icon']))<i class="{{ $action['icon'] }} mr-1"></i>@endif
|
|
{{ $action['label'] ?? 'Azione' }}
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@if(!empty($stats))
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4">
|
|
@foreach($stats as $s)
|
|
<div class="bg-gradient-to-br from-gray-50 to-white border border-gray-200 rounded-lg p-4">
|
|
<div class="text-sm text-gray-500 flex items-center">
|
|
@if(!empty($s['icon']))<i class="{{ $s['icon'] }} mr-2 text-gray-400"></i>@endif
|
|
{{ $s['label'] ?? '' }}
|
|
</div>
|
|
<div class="text-xl font-semibold text-gray-800">{{ $s['value'] ?? '' }}</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|