@props(['fileType', 'size' => '1.2rem', 'showLabel' => false, 'showImage' => false, 'imageUrl' => null, 'rotatingToolbar' => false, 'documentId' => null, 'allImages' => [],'currentIndex' => 0]) @php $fileIcon = get_file_type_icon($fileType); // Normalize file type to handle both MIME types and extensions $normalizedType = strtolower($fileType); // Check if it's an image (support both MIME types and extensions) $imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'tiff', 'tif', 'heic', 'heif']; $imageMimeTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'image/bmp', 'image/webp', 'image/svg+xml', 'image/tiff', 'image/tif', 'image/heic', 'image/heif', 'image/heic-sequence']; // Also check if the normalized type contains 'heic' or 'heif' to catch any variations $isHeic = str_contains($normalizedType, 'heic') || str_contains($normalizedType, 'heif'); $isImage = in_array($normalizedType, $imageExtensions) || in_array($normalizedType, $imageMimeTypes) || $isHeic || str_contains($normalizedType, 'image/'); // Check if it's a PDF (support both MIME type and extension) $isPdf = $normalizedType === 'application/pdf' || $normalizedType === 'pdf'; @endphp