refactor(ui): extract admin mini bar component and reuse in expiry top10

This commit is contained in:
萝卜
2026-03-17 08:51:22 +08:00
parent bbbbfbe478
commit 268fec7d53
2 changed files with 35 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
@php
/**
* Admin UI Component: Mini Bar
*
* Required:
* - $pct
*
* Optional:
* - $role (data-role)
* - $title
*/
$pct = (float) ($pct ?? 0);
$role = (string) ($role ?? '');
$title = (string) ($title ?? '');
$pct = max(0, min(100, $pct));
@endphp
<div class="adm-mini-bar"
@if($role !== '') data-role="{{ $role }}" @endif
@if($title !== '') title="{{ $title }}" @endif
>
<span class="adm-mini-bar-fill" style="width: {{ $pct }}%"></span>
</div>