@if(session()->has('document-upload-error')) @else
{{ $this->name }} @if($isRequired)*@endif
{{-- Show upload form when no file is uploaded --}} @if (empty($this->documents[$this->document_id]['path']))
Allowed: {{ $this->fileType === 'image' ? 'JPG, JPEG, PNG' : 'PDF' }} | Max size: {{ $this->maxSizeKB }} KB @if($this->fileType === 'image' && $this->validateDimensions) | Dimensions: @if($this->width && $this->height) {{ $this->width }}x{{ $this->height }}px @endif @endif
@error('file')
{{ $message }}
@enderror
{{-- Preview for images only --}} @if ($file && $this->fileType === 'image' && in_array(strtolower($file->getClientOriginalExtension()), ['jpg','jpeg','png']))
Preview
@endif {{-- PDF icon preview --}} @if ($file && $this->fileType === 'pdf')
@endif
@if ($file) @endif
@else {{-- Show uploaded file info with preview --}}
{{-- Thumbnail preview --}} @php $previewPath = $this->documents[$this->document_id]['path']; $previewUrl = asset('storage/' . \Illuminate\Support\Str::after($previewPath, 'public/')); @endphp @if($this->fileType === 'image') {{-- Image thumbnail --}}
{{ $this->name }}
@else {{-- PDF icon --}}
@endif {{ $this->documents[$this->document_id]['file_name'] }} @if($this->documents[$this->document_id]['is_delete']) @endif
@endif {{-- Old Attachments --}} @if (!empty($oldAttachments[$document_id]) && count($oldAttachments[$document_id]) > 0) @if ($showOldAttachment) @endif @endif @endif