@props([
    'status' => 'default',
    'label' => null,
])

@php
    $text = $label ?? $slot;
    $class = match (strtolower((string) $status)) {
        'active', 'confirmed', 'paid', 'accepted', 'issued', 'due' => 'badge-status-' . strtolower((string) $status),
        'inactive', 'cancelled', 'void', 'overdue', 'draft', 'provisional' => 'badge-status-' . strtolower((string) $status),
        default => 'bg-secondary',
    };
    $isCustom = str_starts_with($class, 'badge-status-');
@endphp

<span {{ $attributes->merge(['class' => 'badge rounded-pill ' . ($isCustom ? $class : $class . ' text-white')]) }}>
    {{ $text }}
</span>
