@extends('layouts.app') @section('mobile-title', $document->title) @section('mobile-subtitle', 'Document details') @section('mobile-back', route('documents.folders.show', $folder)) @section('mobile-action-url', route('documents.download', $document)) @section('mobile-action-icon', 'download') @section('mobile-action-label', 'Download') @section('content') @php $mime = $document->mime_type ?? ''; $name = strtolower($document->original_name ?? ''); $isPdf = str_contains($mime, 'pdf') || str_ends_with($name, '.pdf'); $isImage = str_starts_with($mime, 'image/'); $isText = in_array($mime, ['text/plain', 'text/csv', 'message/rfc822'], true); $previewUrl = $document->canPreview() && ! $document->archived_at ? route('documents.preview', $document) : null; $humanSize = $document->size >= 1048576 ? number_format($document->size / 1048576, 2).' MB' : number_format($document->size / 1024, 1).' KB'; $shareActivity = $document->shares->flatMap(fn ($share) => $shareAuditLogs->get($share->id, collect()))->take(6); $fileKind = match (true) { $isPdf => 'PDF', $isImage => 'Image', str_contains($mime, 'spreadsheet') || str_ends_with($name, '.csv') || str_ends_with($name, '.xlsx') => 'Spreadsheet', str_contains($mime, 'word') || str_ends_with($name, '.doc') || str_ends_with($name, '.docx') => 'Document', str_contains($mime, 'message') || str_ends_with($name, '.eml') => 'Email', default => 'File', }; @endphp
Document Centre chevron_right {{ $folder->name }} chevron_right {{ $document->title }}

{{ $document->title }}

@include('partials.status-badge', ['status' => $document->status]) @include('partials.status-badge', ['status' => $document->scan_status]) @if ($document->hasLegalHold()) @include('partials.status-badge', ['status' => 'legal_hold']) @endif

{{ $document->original_name }} · {{ $fileKind }} · v{{ $document->version }} · {{ $humanSize }}

@if ($document->isAuthored() && ! $document->archived_at) @can('update', $document) editEdit @endcan descriptionWord picture_as_pdfPDF @endif @if ($previewUrl) open_in_new Open @endif @if (! $document->archived_at) download Download @endif folder_open Folder

Document Preview

{{ $mime ?: 'application/octet-stream' }}

zoom_in zoom_out print
@if ($previewUrl && $isImage)
{{ $document->title }}
@elseif ($previewUrl && ($isPdf || $isText)) @elseif ($previewUrl) @else
Stephup Construction
{{ $document->document_type ?: $fileKind }} · {{ $folder->name }}
v{{ $document->version }}
{{ $document->created_at->format('M j, Y') }}
draft
Preview is not available for this file type. Download the document to inspect the original.
@endif
@can('review', $document) @if (! $document->archived_at) @endif @endcan @endsection