{{-- Header with Title, Filters, Sorting, and Search --}}

@lang('Content Manager')

{{-- Filters Tabs --}}
    @foreach ($filters as $filter)
  • @endforeach
{{-- Sorting & Search --}}
{{ __('Sort by') }}
@foreach ($sortButtons as $button) @endforeach
{{-- Search input with clear button --}}
@if (!empty($searchTerm)) @endif {{-- Search loading indicator --}}
{{-- Upload Files Section --}} @if ($activeFilter === 'Upload Files')
{{-- Upload Area --}}

@lang('Drag and Drop a File')

@lang('or')
{{-- File Processing Indicator --}}
@lang('Processing selected files')...

@lang('Please wait, validating large files may take a moment.')

{{-- File List --}} @if (count($uploadingFiles))
    @foreach ($uploadingFiles as $file)
  • {{ $file?->getClientOriginalName() }} {{ number_format($file?->getSize() / 1024, 1) }} KB
  • @endforeach
@endif {{-- Upload Errors --}} @if (!empty($uploadErrors))
    @foreach ($uploadErrors as $error)
  • • {{ $error }}
  • @endforeach
@endif {{-- Upload Progress --}} @if ($isUploading && !empty($uploadProgress))
{{ $uploadProgress }}
@endif {{-- Upload Success --}} @if (!empty($uploadedFiles) && !$isUploading)

✓ {{ count($uploadedFiles) }} file(s) uploaded successfully!

    @foreach ($uploadedFiles as $file)
  • • {{ $file['name'] }}
  • @endforeach
@endif {{-- Action Buttons --}}
@if ($app_is_demo) {{ count($uploadingFiles) ? __('Add More') : __('Browse Files') }} @else {{ count($uploadingFiles) ? __('Add More') : __('Browse Files') }} @endif

@lang('Max :max files, :maxSize MB each.', [ 'max' => setting('media_max_files', 5), 'maxSize' => setting('media_max_size', 25), ])
@lang('Allowed types: :types', [ 'types' => setting('media_allowed_types', 'jpg,png,gif,webp,svg,mp4,avi,mov,wmv,flv,webm,mp3,wav,m4a,pdf,doc,docx,xls,xlsx'), ])

@endif {{-- Images Section --}} @if ($activeFilter === 'Images')
{{-- Search results info --}} @if (!empty($searchTerm))
@if ($images->count() > 0) @lang('Found :count images for', ['count' => $images->count()]) "{{ $searchTerm }}" @else @lang('No images found for') "{{ $searchTerm }}" @endif
@endif
@forelse ($images as $image) @php $isDisabledImage = $this->isCardDisabled('image', $this->allowedTypes); @endphp
{{ $image->title ?? $image->input }}
{{ $image->title ?? Str::limit($image->input ?? ($image->filename ?? 'Untitled'), 30) }}
{{-- Show creation date on hover --}}
{{ $image->format_date ?? $image->created_at->format('M d, Y') }}
{{-- Selection indicator --}} @if (in_array((string) $image->id, $selectedImages ?? [], true)) @endif
@empty

@lang('No images found.')

@if (!empty($searchTerm))

@lang('Try adjusting your search term.')

@endif
@endforelse
{{-- Loading indicator --}} @if ($hasMoreImages && !$isLoading && $images->count() > 0)
@lang('Scroll for more images...')
@endif {{-- Loading spinner --}}
@if (!empty($selectedImages) && count($selectedImages) > 0)
@lang($allowMultipleSelection ? 'Insert Selected Images' : 'Insert Selected Image') @if ($allowMultipleSelection) ({{ count($selectedImages) }}) @endif
@endif @endif {{-- Videos Section --}} @if ($activeFilter === 'Videos')
{{-- Search results info --}} @if (!empty($searchTerm))
@if ($videos->count() > 0) @lang('Found :count videos for', ['count' => $videos->count()]) "{{ $searchTerm }}" @else @lang('No videos found for') "{{ $searchTerm }}" @endif
@endif
@forelse ($videos as $video) @php $isDisabledVideo = $this->isCardDisabled('video', $this->allowedTypes); @endphp
{{-- Video thumbnail or video player --}} @if (isset($video->output_url) && $video->output_url)
{{-- Static thumbnail/placeholder shown initially --}}
{{-- Video element (initially without src) --}}
@else
@endif {{-- Video Controls Overlay --}} @if (isset($video->output_url) && $video->output_url)
@endif
{{ $video->title ?? Str::limit($video->input ?? ($video->filename ?? 'Untitled'), 30) }}
{{-- Show creation date on hover --}}
{{ $video->format_date ?? $video->created_at->format('M d, Y') }}
{{-- Selection indicator --}} @if (in_array((string) $video->id, $selectedVideos ?? [], true)) @endif @if (!in_array((string) $video->id, $selectedVideos ?? [], true))
@endif
@empty

@lang('No videos found.')

@if (!empty($searchTerm))

@lang('Try adjusting your search term.')

@endif
@endforelse
{{-- Loading indicator --}} @if ($hasMoreVideos && !$isLoading && $videos->count() > 0)
@lang('Scroll for more videos...')
@endif {{-- Loading spinner --}}
@if (!empty($selectedVideos) && count($selectedVideos) > 0)
@lang($allowMultipleSelection ? 'Insert Selected Videos' : 'Insert Selected Video') @if ($allowMultipleSelection && count($selectedVideos)) ({{ count($selectedVideos) }}) @endif
@endif @endif {{-- Other Files Section --}} @if ($activeFilter === 'Other Files')
{{-- Search results info --}} @if (!empty($searchTerm))
@if ($otherFiles->count() > 0) @lang('Found :count files for', ['count' => $otherFiles->count()]) "{{ $searchTerm }}" @else @lang('No files found for') "{{ $searchTerm }}" @endif
@endif
@forelse ($otherFiles as $file) @php $isDisabledOther = $this->isCardDisabled('other', $this->allowedTypes); @endphp
{{-- File icon based on extension --}}
@if (in_array($file->extension, ['pdf'])) @elseif (in_array($file->extension, ['doc', 'docx'])) @elseif (in_array($file->extension, ['xls', 'xlsx'])) @elseif (in_array($file->extension, ['ppt', 'pptx'])) @else @endif
{{-- File info --}}

{{ \Illuminate\Support\Str::limit($file->filename, 20, '...') }}

{{ strtoupper($file->extension) }} • {{ number_format($file->file_size / 1024, 1) }} KB

{{ $file->format_date }}

{{-- Selection indicator --}} @if (in_array((string) $file->id, $selectedOtherFiles ?? [], true)) @endif
@empty

@lang('No files found.')

@if (!empty($searchTerm))

@lang('Try adjusting your search term.')

@endif
@endforelse
{{-- Loading indicator --}} @if ($hasMoreOtherFiles && !$isLoading && $otherFiles->count() > 0)
@lang('Scroll for more files...')
@endif {{-- Loading spinner --}}
@if (!empty($selectedOtherFiles) && count($selectedOtherFiles) > 0)
@lang('Insert Selected Files') ({{ count($selectedOtherFiles) }})
@endif @endif {{-- Google Drive Section --}} @if ($activeFilter === 'Google Drive')

@lang('Google Drive integration coming soon...')

@endif {{-- Stock Images Section --}} @if ($activeFilter === 'Stock Images')
{{-- Search results info --}} @if (!empty($searchTerm))
@if ($stockImages->count() > 0) @lang('Found :count stock images for', ['count' => $stockImages->count()]) "{{ $searchTerm }}" @else @lang('No stock images found for') "{{ $searchTerm }}" @endif
@endif
@forelse ($stockImages as $stockImage) @php $isDisabledImage = $this->isCardDisabled('image', $this->allowedTypes); // Check if this stock image is selected $isSelected = in_array((string) $stockImage->id, $selectedStockImages ?? [], true); @endphp
{{ $stockImage->title }} {{-- Title overlay - matches images section style --}}
{{ Str::limit($stockImage->title ?? 'Untitled', 30) }}
{{-- Selection indicator --}} @if ($isSelected) @endif
@empty
@if (empty($searchTerm))

@lang('Enter a search term to find stock images')

@else

@lang('No stock images found for') "{{ $searchTerm }}"

@lang('Try adjusting your search term.')

@endif
@endforelse
{{-- Loading spinner --}}
{{-- Insert button for selected stock images --}} @if (!empty($selectedStockImages) && count($selectedStockImages) > 0)
@lang($allowMultipleSelection ? 'Download & Insert Selected Images' : 'Download & Insert Selected Image') @if ($allowMultipleSelection) ({{ count($selectedStockImages) }}) @endif @lang('Downloading...')
@endif @endif {{-- Stock Videos Section --}} @if ($activeFilter === 'Stock Videos')
{{-- Search results info --}} @if (!empty($searchTerm))
@if ($stockVideos->count() > 0) @lang('Found :count stock videos for', ['count' => $stockVideos->count()]) "{{ $searchTerm }}" @else @lang('No stock videos found for') "{{ $searchTerm }}" @endif
@endif
@forelse ($stockVideos as $stockVideo) @php $isDisabledVideo = $this->isCardDisabled('video', $this->allowedTypes); // Check if this stock video is selected $isSelected = in_array((string) $stockVideo->id, $selectedStockVideos ?? [], true); @endphp
{{-- Video thumbnail with hidden video player --}} @if ($stockVideo->thumbnail)
{{ $stockVideo->title }} {{-- Hidden video player for stock videos --}} @if ($stockVideo->preview_url || $stockVideo->url) @endif
@else
@endif {{-- Video Controls Overlay --}} @if ($stockVideo->preview_url || $stockVideo->url)
@endif {{-- Duration badge --}} @if ($stockVideo->duration > 0)
{{ gmdate('i:s', $stockVideo->duration) }}
@endif {{-- Title overlay --}}
{{ Str::limit($stockVideo->title ?? 'Untitled', 30) }}
{{-- Selection indicator --}} @if ($isSelected) @endif
@empty
@if (empty($searchTerm))

@lang('Enter a search term to find stock videos')

@else

@lang('No stock videos found for') "{{ $searchTerm }}"

@lang('Try adjusting your search term.')

@endif
@endforelse
{{-- Loading spinner --}}
{{-- Insert button for selected stock videos --}} @if (!empty($selectedStockVideos) && count($selectedStockVideos) > 0)
@lang($allowMultipleSelection ? 'Download & Insert Selected Videos' : 'Download & Insert Selected Video') @if ($allowMultipleSelection) ({{ count($selectedStockVideos) }}) @endif @lang('Downloading...')
@endif @endif