{{-- The generic CRM uploader and file list (App\Livewire\Crm\Attachments). Mounted by name on any CRM record; see the class for the contract. --}}
@if ($canAttach)
@if ($category === null)
@endif

{{ __('Up to :mb MB a file. Files are saved as soon as they finish uploading.', ['mb' => $maxMb]) }}

@endif
@forelse ($files as $file) @empty @endforelse
{{ __('File') }} {{ __('Type') }} {{ __('Added') }} {{ __('Actions') }}
{{ $file->original_name }} @if ($file->description)

{{ $file->description }}

@endif

@if ($file->isExternal()) {{ __('Link') }} @elseif ($file->size !== null) {{-- Number::fileSize() needs the intl extension, which the live host lacks. --}} {{ $file->size >= 1048576 ? number_format($file->size / 1048576, 1).' MB' : number_format(max(1, $file->size / 1024)).' KB' }} @endif

{{ __($categories[$file->category] ?? 'Other') }} {{ $file->created_at?->timezone(config('app.display_timezone'))->format('j M Y') }} {{ $file->uploader?->name ?? __('Not available') }}
@unless ($file->isExternal()) {{ __('Download') }} @endunless @can('delete', $file) @endcan
@include('livewire.crm.partials.paginator', ['rows' => $files])
@if ($canAttach) {{ __('Add a link to a file') }}
@if ($category === null)
@endif
{{ __('Cancel') }} {{ __('Add link') }} {{ __('Saving…') }}
@endif