diff --git a/frontend/src/core/hooks/useFileActionIcons.tsx b/frontend/src/core/hooks/useFileActionIcons.tsx index ec1cdbfca..3f67a2ddf 100644 --- a/frontend/src/core/hooks/useFileActionIcons.tsx +++ b/frontend/src/core/hooks/useFileActionIcons.tsx @@ -1,13 +1,33 @@ +import React from 'react'; import LocalIcon from '@app/components/shared/LocalIcon'; +// Type for icon wrapper props (matches MUI fontSize convention) +interface FileActionIconProps { + fontSize?: 'small' | 'medium' | 'large'; + width?: string | number; + height?: string | number; + style?: React.CSSProperties; + className?: string; +} + +// Type for icon wrapper component +type FileActionIconComponent = React.FC; + /** * File action icons for web builds * Desktop builds override this with different icons */ export function useFileActionIcons() { // Create wrapper components for LocalIcon that match the MUI icon interface - const UploadIcon = (props: any) => ; - const DownloadIcon = (props: any) => ; + const UploadIcon: FileActionIconComponent = (props) => { + const size = props.fontSize === 'small' ? 20 : 24; + return ; + }; + + const DownloadIcon: FileActionIconComponent = (props) => { + const size = props.fontSize === 'small' ? 20 : 24; + return ; + }; return { upload: UploadIcon, diff --git a/frontend/src/core/hooks/useSuggestedTools.tsx b/frontend/src/core/hooks/useSuggestedTools.tsx index e41f9cb84..c0d06fbd4 100644 --- a/frontend/src/core/hooks/useSuggestedTools.tsx +++ b/frontend/src/core/hooks/useSuggestedTools.tsx @@ -1,21 +1,32 @@ -import { useMemo } from 'react'; +import React, { useMemo } from 'react'; import { useNavigationState } from '@app/contexts/NavigationContext'; import { useToolNavigation } from '@app/hooks/useToolNavigation'; import { useToolWorkflow } from '@app/contexts/ToolWorkflowContext'; import { ToolId } from '@app/types/toolId'; import LocalIcon from '@app/components/shared/LocalIcon'; -// Icon wrapper components -const CompressIcon = (props: any) => ; -const SwapHorizIcon = (props: any) => ; -const CleaningServicesIcon = (props: any) => ; -const CropIcon = (props: any) => ; -const TextFieldsIcon = (props: any) => ; +// Type for the props that icon wrapper components accept +interface IconWrapperProps { + width?: string | number; + height?: string | number; + style?: React.CSSProperties; + className?: string; +} + +// Type for an icon wrapper component +type IconWrapperComponent = React.FC; + +// Factory function to create icon wrapper components +function createIconComponent(iconName: string): IconWrapperComponent { + return (props: IconWrapperProps) => ( + + ); +} export interface SuggestedTool { id: ToolId; title: string; - icon: React.ComponentType; + icon: IconWrapperComponent; href: string; onClick: (e: React.MouseEvent) => void; } @@ -24,27 +35,27 @@ const ALL_SUGGESTED_TOOLS: Omit[] = [ { id: 'compress', title: 'Compress', - icon: CompressIcon + icon: createIconComponent('compress-rounded'), }, { id: 'convert', title: 'Convert', - icon: SwapHorizIcon + icon: createIconComponent('swap-horiz-rounded'), }, { id: 'sanitize', title: 'Sanitize', - icon: CleaningServicesIcon + icon: createIconComponent('cleaning-services-rounded'), }, { id: 'split', title: 'Split', - icon: CropIcon + icon: createIconComponent('crop-rounded'), }, { id: 'ocr', title: 'OCR', - icon: TextFieldsIcon + icon: createIconComponent('text-fields-rounded'), } ]; @@ -68,7 +79,7 @@ export function useSuggestedTools(): SuggestedTool[] { onClick: (e: React.MouseEvent) => { e.preventDefault(); } }; } - + const navProps = getToolNavigation(tool.id, toolRegistryEntry); return { ...tool, diff --git a/frontend/src/desktop/hooks/useFileActionIcons.tsx b/frontend/src/desktop/hooks/useFileActionIcons.tsx index 97ee110c6..da6391015 100644 --- a/frontend/src/desktop/hooks/useFileActionIcons.tsx +++ b/frontend/src/desktop/hooks/useFileActionIcons.tsx @@ -1,13 +1,33 @@ +import React from 'react'; import LocalIcon from '@app/components/shared/LocalIcon'; +// Type for icon wrapper props (matches MUI fontSize convention) +interface FileActionIconProps { + fontSize?: 'small' | 'medium' | 'large'; + width?: string | number; + height?: string | number; + style?: React.CSSProperties; + className?: string; +} + +// Type for icon wrapper component +type FileActionIconComponent = React.FC; + /** * File action icons for desktop builds * Overrides core implementation with desktop-appropriate icons */ export function useFileActionIcons() { // Create wrapper components for LocalIcon that match the MUI icon interface - const FolderOpenIcon = (props: any) => ; - const SaveIcon = (props: any) => ; + const FolderOpenIcon: FileActionIconComponent = (props) => { + const size = props.fontSize === 'small' ? 20 : 24; + return ; + }; + + const SaveIcon: FileActionIconComponent = (props) => { + const size = props.fontSize === 'small' ? 20 : 24; + return ; + }; return { upload: FolderOpenIcon,