Files
siakad/resources/views/components/ui/stat.blade.php
T

15 lines
698 B
PHP

{{-- Kartu angka tunggal dengan ikon. Nilai harus nyata dari DB. Dengan href, seluruh kartu menjadi tautan. --}}
@props(['label', 'value', 'icon' => 'chart-bar', 'hint' => null, 'href' => null])
@php
$shown = is_int($value) ? number_format($value, 0, ',', '.') : $value;
$tag = $href ? 'a' : 'div';
@endphp
<x-glass.panel :as="$tag" :href="$href" {{ $attributes->class('stat') }}>
<span class="stat__icon" aria-hidden="true"><x-dynamic-component :component="'heroicon-o-'.$icon" /></span>
<span class="stat__label">{{ $label }}</span>
<span class="stat__value" data-count>{{ $shown }}</span>
@if ($hint) <span class="stat__hint">{{ $hint }}</span> @endif
</x-glass.panel>