import { FileWithUrl } from "../../types/file"; import { useToolManagement } from "../../hooks/useToolManagement"; interface ToolRendererProps { selectedToolKey: string; pdfFile: any; files: FileWithUrl[]; toolParams: any; updateParams: (params: any) => void; toolSelectedFiles?: File[]; onPreviewFile?: (file: File | null) => void; } const ToolRenderer = ({ selectedToolKey, files, toolParams, updateParams, toolSelectedFiles = [], onPreviewFile, }: ToolRendererProps) => { // Get the tool from registry const { toolRegistry } = useToolManagement(); const selectedTool = toolRegistry[selectedToolKey]; if (!selectedTool || !selectedTool.component) { return
Tool not found: {selectedToolKey}
; } const ToolComponent = selectedTool.component; // Pass tool-specific props switch (selectedToolKey) { case "split": return ( ); case "compress": return ( {}} params={toolParams} updateParams={updateParams} /> ); case "merge": return ( ); default: return ( ); } }; export default ToolRenderer;