import React from "react"; import { Tooltip, ActionIcon, Paper } from "@mantine/core"; import UndoIcon from "@mui/icons-material/Undo"; import RedoIcon from "@mui/icons-material/Redo"; import ContentCutIcon from "@mui/icons-material/ContentCut"; import DownloadIcon from "@mui/icons-material/Download"; import RotateLeftIcon from "@mui/icons-material/RotateLeft"; import RotateRightIcon from "@mui/icons-material/RotateRight"; import DeleteIcon from "@mui/icons-material/Delete"; import CloseIcon from "@mui/icons-material/Close"; interface PageEditorControlsProps { // Close/Reset functions onClosePdf: () => void; // Undo/Redo onUndo: () => void; onRedo: () => void; canUndo: boolean; canRedo: boolean; // Page operations onRotate: (direction: 'left' | 'right') => void; onDelete: () => void; onSplit: () => void; // Export functions onExportSelected: () => void; onExportAll: () => void; exportLoading: boolean; // Selection state selectionMode: boolean; selectedPages: string[]; } const PageEditorControls = ({ onClosePdf, onUndo, onRedo, canUndo, canRedo, onRotate, onDelete, onSplit, onExportSelected, onExportAll, exportLoading, selectionMode, selectedPages }: PageEditorControlsProps) => { return (
{/* Close PDF */}
{/* Undo/Redo */}
{/* Page Operations */} onRotate('left')} disabled={selectionMode && selectedPages.length === 0} variant={selectionMode && selectedPages.length > 0 ? "light" : "default"} color={selectionMode && selectedPages.length > 0 ? "blue" : undefined} size="lg" > onRotate('right')} disabled={selectionMode && selectedPages.length === 0} variant={selectionMode && selectedPages.length > 0 ? "light" : "default"} color={selectionMode && selectedPages.length > 0 ? "blue" : undefined} size="lg" > 0 ? "light" : "default"} size="lg" > 0 ? "light" : "default"} color={selectionMode && selectedPages.length > 0 ? "blue" : undefined} size="lg" >
{/* Export Controls */} {selectionMode && selectedPages.length > 0 && ( )}
); }; export default PageEditorControls;