@props([
    'category' => 'other',
    'severity' => null,
    'page' => null,
    'document' => null,
])

@php
    $label = \App\Models\Dsar\DsarEvidenceItem::categoryLabel($category);
    $colour = \App\Models\Dsar\DsarEvidenceItem::categoryColour($category);
    $severityClass = match ($severity) {
        'high' => 'text-danger',
        'medium' => 'text-warning',
        'low' => 'text-secondary',
        default => 'text-muted',
    };
@endphp

<span {{ $attributes->merge(['class' => 'd-inline-flex align-items-center gap-1 small']) }}>
    <span class="badge rounded-pill" style="background: {{ $colour }}1a; color: {{ $colour }}; font-weight: 600;">
        <span class="mdi mdi-shield-search" aria-hidden="true"></span>
        {{ $label }}
    </span>
    @if($severity)
        <span class="{{ $severityClass }} text-uppercase fw-semibold" style="font-size: .68rem;"
              title="Confidence proxy (finding severity)">
            {{ $severity }}
        </span>
    @endif
    @if($document)
        <span class="text-muted text-truncate" style="max-width: 12rem;" title="{{ $document }}">
            <span class="mdi mdi-file-document-outline" aria-hidden="true"></span>
            {{ $document }}@if($page) · p{{ $page }}@endif
        </span>
    @elseif($page)
        <span class="text-muted">p{{ $page }}</span>
    @endif
</span>
