Add delete button with confirm modal on each recordings list row.
This commit is contained in:
@@ -85,6 +85,7 @@
|
||||
<flux:table.column>Words</flux:table.column>
|
||||
<flux:table.column>Status</flux:table.column>
|
||||
<flux:table.column>Uploaded</flux:table.column>
|
||||
<flux:table.column class="w-24"></flux:table.column>
|
||||
</flux:table.columns>
|
||||
|
||||
<flux:table.rows>
|
||||
@@ -152,6 +153,42 @@
|
||||
<flux:table.cell>
|
||||
{{ $recording->created_at?->format('Y-m-d H:i') }}
|
||||
</flux:table.cell>
|
||||
<flux:table.cell>
|
||||
<flux:modal.trigger name="delete-recording-{{ $recording->id }}">
|
||||
<flux:button
|
||||
type="button"
|
||||
variant="danger"
|
||||
size="sm"
|
||||
square
|
||||
aria-label="Delete {{ $recording->title }}"
|
||||
>
|
||||
<flux:icon.trash variant="micro" />
|
||||
</flux:button>
|
||||
</flux:modal.trigger>
|
||||
|
||||
<flux:modal name="delete-recording-{{ $recording->id }}" class="max-w-md">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg">Delete recording?</flux:heading>
|
||||
<flux:text class="mt-2">
|
||||
This permanently removes “{{ $recording->title }}” and its audio file.
|
||||
</flux:text>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2">
|
||||
<flux:modal.close>
|
||||
<flux:button variant="ghost">Cancel</flux:button>
|
||||
</flux:modal.close>
|
||||
<flux:button
|
||||
type="button"
|
||||
variant="danger"
|
||||
wire:click="delete({{ $recording->id }})"
|
||||
>
|
||||
Delete
|
||||
</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</flux:modal>
|
||||
</flux:table.cell>
|
||||
</flux:table.row>
|
||||
@endforeach
|
||||
</flux:table.rows>
|
||||
|
||||
Reference in New Issue
Block a user