@props(['status'])

@php
    $normalized = strtolower(str_replace(' ', '_', (string) $status));
    $map = [
        'active' => 'success',
        'verified' => 'success',
        'approved' => 'success',
        'posted' => 'success',
        'won' => 'success',
        'open' => 'success',
        'disbursed' => 'info',
        'pending' => 'warning',
        'submitted' => 'warning',
        'underwriting' => 'warning',
        'in_review' => 'warning',
        'draft' => 'neutral',
        'new' => 'info',
        'contacted' => 'info',
        'qualified' => 'info',
        'proposal' => 'navy',
        'in_arrears' => 'danger',
        'rejected' => 'danger',
        'lost' => 'danger',
        'blacklisted' => 'danger',
        'closed' => 'neutral',
        'inactive' => 'neutral',
        'cancelled' => 'neutral',
    ];
    $variant = $map[$normalized] ?? 'neutral';
    $label = ucwords(str_replace('_', ' ', $normalized));
@endphp

<span {{ $attributes->merge(['class' => "fundi-badge fundi-badge--{$variant}"]) }}>{{ $label }}</span>
