import React from "react"; import { Stack, Box, Text, Button, ActionIcon, Center } from "@mantine/core"; import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import { useTranslation } from "react-i18next"; import { getFileSize } from "@app/utils/fileUtils"; import { StirlingFileStub } from "@app/types/fileContext"; import { PrivateContent } from "@app/components/shared/PrivateContent"; interface CompactFileDetailsProps { currentFile: StirlingFileStub | null; thumbnail: string | null; selectedFiles: StirlingFileStub[]; currentFileIndex: number; numberOfFiles: number; isAnimating: boolean; onPrevious: () => void; onNext: () => void; onOpenFiles: () => void; } const CompactFileDetails: React.FC = ({ currentFile, thumbnail, selectedFiles, currentFileIndex, numberOfFiles, isAnimating, onPrevious, onNext, onOpenFiles, }) => { const { t } = useTranslation(); const hasSelection = selectedFiles.length > 0; const hasMultipleFiles = numberOfFiles > 1; const showOwner = Boolean( currentFile && (currentFile.remoteOwnedByCurrentUser === false || currentFile.remoteSharedViaLink), ); const ownerLabel = currentFile ? currentFile.remoteOwnerUsername || t("fileManager.ownerUnknown", "Unknown") : ""; return ( {/* Compact mobile layout */} {/* Small preview */} {currentFile && thumbnail ? ( {currentFile.name} ) : currentFile ? (
) : null}
{/* File info */} {currentFile ? currentFile.name : "No file selected"} {currentFile ? getFileSize(currentFile) : ""} {selectedFiles.length > 1 && ` • ${selectedFiles.length} files`} {currentFile && ` • v${currentFile.versionNumber || 1}`} {hasMultipleFiles && ( {currentFileIndex + 1} of {selectedFiles.length} )} {/* Compact tool chain for mobile */} {currentFile?.toolHistory && currentFile.toolHistory.length > 0 && ( {currentFile.toolHistory.map((tool) => t(`home.${tool.toolId}.title`, tool.toolId)).join(" → ")} )} {currentFile && showOwner && ( {t("fileManager.owner", "Owner")}: {ownerLabel} )} {/* Navigation arrows for multiple files */} {hasMultipleFiles && ( )}
{/* Action Button */}
); }; export default CompactFileDetails;