Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions resources/views/livewire/dashboard/dashboard-converter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ class="flex flex-col items-center justify-center gap-4 rounded-[var(--ca-radius-
</div>
</div>

@if (empty($this->targetFormatCards))
<div class="rounded-[var(--ca-radius-md)] border border-dashed border-[var(--ca-border)] bg-[var(--ca-surface-muted)]/40 px-6 py-8 text-center">
<p class="text-base font-semibold text-[var(--ca-text)]">No conversion targets available</p>
<p class="mt-1 text-sm text-[var(--ca-muted)]">We cannot convert this file type yet. Upload another file or check supported formats later.</p>
<div class="mt-4 flex justify-center">
<x-button variant="secondary" size="sm" wire:click="replaceFile">Upload another file</x-button>
</div>
</div>
@else
<div class="flex flex-col gap-3">
<p class="text-base font-semibold text-[var(--ca-text)]">Convert {{ strtoupper($file->extension) }} to</p>
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
Expand All @@ -88,6 +97,7 @@ class="flex items-start gap-3 rounded-[var(--ca-radius-md)] border border-[var(-
@endforeach
</div>
</div>
@endif
</div>
@endif
</x-card>
Expand Down
14 changes: 14 additions & 0 deletions tests/Feature/Livewire/DashboardConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,17 @@
->call('goToFormatStep')
->assertSee('Recommended');
});

it('shows an empty state when the source format has no available targets', function () {
$user = User::factory()->create();
$file = FileRecord::factory()->for($user)->create(['extension' => 'pdf']);

Livewire::actingAs($user)
->test(DashboardConverter::class)
->set('currentFileId', $file->id)
->call('goToFormatStep')
->assertSet('step', 'format')
->assertSee('No conversion targets available')
->assertSee('Upload another file')
->assertDontSee('Convert PDF to');
});