39 lines
1.8 KiB
PHP
39 lines
1.8 KiB
PHP
@php
|
|
$files = $getState() ?? [];
|
|
$files = is_array($files) ? array_values(array_filter($files)) : [];
|
|
$urls = array_values(array_map(
|
|
fn ($path) => \Illuminate\Support\Facades\Storage::disk('public')->url($path),
|
|
$files
|
|
));
|
|
@endphp
|
|
|
|
@if(count($urls) > 0)
|
|
<div class="flex flex-col gap-1.5">
|
|
@foreach($urls as $idx => $url)
|
|
@php
|
|
$filename = basename(parse_url($url, PHP_URL_PATH));
|
|
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
|
$isVideo = in_array($ext, ['mp4', 'mov', 'avi', 'mkv', 'webm']);
|
|
@endphp
|
|
<a
|
|
href="{{ $url }}"
|
|
target="_blank"
|
|
download
|
|
class="flex items-center gap-2 text-sm text-primary-600 hover:text-primary-800 transition-colors"
|
|
>
|
|
@if($isVideo)
|
|
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.069A1 1 0 0121 8.879V15.12a1 1 0 01-1.447.894L15 14M3 8a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"/>
|
|
</svg>
|
|
@else
|
|
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"/>
|
|
</svg>
|
|
@endif
|
|
<span class="truncate max-w-[180px]">{{ $idx + 1 }}. {{ $filename }}</span>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
@else
|
|
<span class="text-sm text-gray-400">-</span>
|
|
@endif |