@props([
'status',
'label' => null,
/** @var string|null Alpine expression that returns a row object with badge_color + status_label */
'alpineRow' => null,
])
@php
$label ??= match ($status) {
'pending' => 'Queued',
'processing' => 'Transcribing',
'done' => 'Done',
'failed' => 'Failed',
'cancelled' => 'Cancelled',
default => (string) $status,
};
$color = match ($status) {
'done' => 'teal',
'processing', 'pending' => 'amber',
'failed' => 'red',
default => 'zinc',
};
@endphp
@if ($alpineRow)
class('inline-flex') }}>
@foreach (['teal', 'amber', 'red', 'zinc'] as $badgeColor)
@if ($badgeColor === $color)
{{ $label }}
@else
{{ $label }}
@endif
@endforeach
@else
{{ $label }}
@endif