@props([
    'status' => 'manual',
    'origin' => null,
])

@php
    [$icon, $class, $label] = match ($status) {
        'suggested' => ['lightbulb-on-outline', 'bg-warning-subtle text-warning-emphasis', 'Awaiting review'],
        'accepted'  => ['check-decagram', 'bg-success-subtle text-success-emphasis', 'Accepted'],
        'edited'    => ['pencil-outline', 'bg-info-subtle text-info-emphasis', 'Edited'],
        'rejected'  => ['close-circle-outline', 'bg-danger-subtle text-danger-emphasis', 'Rejected'],
        default     => ['account-edit-outline', 'bg-secondary-subtle text-secondary-emphasis', 'Manual'],
    };

    $originLabel = match ($origin) {
        'client_data' => 'From client record',
        'claim_data'  => 'From claim record',
        'evidence'    => 'From evidence',
        'previous'    => 'Previous answer',
        'user'        => 'Manual entry',
        default       => null,
    };
@endphp

<span {{ $attributes->merge(['class' => 'd-inline-flex align-items-center gap-2']) }}>
    <span class="badge rounded-pill {{ $class }}" style="font-weight: 600;">
        <span class="mdi mdi-{{ $icon }}" aria-hidden="true"></span>
        {{ $label }}
    </span>
    @if($originLabel)
        <span class="text-muted small">
            <span class="mdi mdi-source-branch" aria-hidden="true"></span>
            {{ $originLabel }}
        </span>
    @endif
</span>
