Move recordings UI to Livewire pages with Flux components.
Replace controller-driven Blade views with full-page Livewire index/show/create flows so Flux tables, toasts, and uploads work natively.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
@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)
|
||||
<span {{ $attributes->class('inline-flex') }}>
|
||||
@foreach (['teal', 'amber', 'red', 'zinc'] as $badgeColor)
|
||||
@if ($badgeColor === $color)
|
||||
<flux:badge
|
||||
size="sm"
|
||||
:color="$badgeColor"
|
||||
x-show="{{ $alpineRow }}.badge_color === '{{ $badgeColor }}'"
|
||||
x-text="{{ $alpineRow }}.status_label"
|
||||
>{{ $label }}</flux:badge>
|
||||
@else
|
||||
<flux:badge
|
||||
size="sm"
|
||||
:color="$badgeColor"
|
||||
x-show="{{ $alpineRow }}.badge_color === '{{ $badgeColor }}'"
|
||||
x-cloak
|
||||
x-text="{{ $alpineRow }}.status_label"
|
||||
>{{ $label }}</flux:badge>
|
||||
@endif
|
||||
@endforeach
|
||||
</span>
|
||||
@else
|
||||
<flux:badge size="sm" :color="$color" {{ $attributes }}>
|
||||
{{ $label }}
|
||||
</flux:badge>
|
||||
@endif
|
||||
Reference in New Issue
Block a user