diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4ec7c35..f55a8a7 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,8 +6,8 @@ - - + + - { + "prStates": [ { - "id": { - "id": "PR_kwDOMJIfts51PkS9", - "number": 22 + "id": { + "id": "PR_kwDOMJIfts51PkS9", + "number": 22 }, - "lastSeen": 1741207144695 + "lastSeen": 1741207144695 }, { - "id": { - "id": "PR_kwDOMJIfts6NiNYl", - "number": 32 + "id": { + "id": "PR_kwDOMJIfts6NiNYl", + "number": 32 }, - "lastSeen": 1741209723869 + "lastSeen": 1741209723869 }, { - "id": { - "id": "PR_kwDOMJIfts6Nheyd", - "number": 31 + "id": { + "id": "PR_kwDOMJIfts6Nheyd", + "number": 31 }, - "lastSeen": 1741213371410 + "lastSeen": 1741213371410 }, { - "id": { - "id": "PR_kwDOMJIfts6NmRBs", - "number": 33 + "id": { + "id": "PR_kwDOMJIfts6NmRBs", + "number": 33 }, - "lastSeen": 1741282429036 + "lastSeen": 1741282429036 }, { - "id": { - "id": "PR_kwDOMJIfts5zyFTs", - "number": 15 + "id": { + "id": "PR_kwDOMJIfts5zyFTs", + "number": 15 }, - "lastSeen": 1741535540953 + "lastSeen": 1741535540953 }, { - "id": { - "id": "PR_kwDOMJIfts6QQB3c", - "number": 59 + "id": { + "id": "PR_kwDOMJIfts6QQB3c", + "number": 59 }, - "lastSeen": 1743018960900 + "lastSeen": 1743018960900 }, { - "id": { - "id": "PR_kwDOMJIfts6QMPEg", - "number": 58 + "id": { + "id": "PR_kwDOMJIfts6QMPEg", + "number": 58 }, - "lastSeen": 1743019452983 + "lastSeen": 1743019452983 }, { - "id": { - "id": "PR_kwDOMJIfts6QZvRI", - "number": 61 + "id": { + "id": "PR_kwDOMJIfts6QZvRI", + "number": 61 }, - "lastSeen": 1743103196866 + "lastSeen": 1743103196866 }, { - "id": { - "id": "PR_kwDOMJIfts6QqPrQ", - "number": 73 + "id": { + "id": "PR_kwDOMJIfts6QqPrQ", + "number": 73 }, - "lastSeen": 1743265865001 + "lastSeen": 1743265865001 }, { - "id": { - "id": "PR_kwDOMJIfts6Qp5nI", - "number": 72 + "id": { + "id": "PR_kwDOMJIfts6Qp5nI", + "number": 72 }, - "lastSeen": 1743338472110 + "lastSeen": 1743338472110 }, { - "id": { - "id": "PR_kwDOMJIfts6QsjlS", - "number": 76 + "id": { + "id": "PR_kwDOMJIfts6QsjlS", + "number": 76 }, - "lastSeen": 1743352150953 + "lastSeen": 1743352150953 }, { - "id": { - "id": "PR_kwDOMJIfts6Q0JBe", - "number": 82 + "id": { + "id": "PR_kwDOMJIfts6Q0JBe", + "number": 82 }, - "lastSeen": 1743470267269 + "lastSeen": 1743470267269 }, { - "id": { - "id": "PR_kwDOMJIfts6UE9-x", - "number": 102 + "id": { + "id": "PR_kwDOMJIfts6UE9-x", + "number": 102 }, - "lastSeen": 1747171977348 + "lastSeen": 1747171977348 }, { - "id": { - "id": "PR_kwDOMJIfts6XPua_", - "number": 117 + "id": { + "id": "PR_kwDOMJIfts6XPua_", + "number": 117 }, - "lastSeen": 1747929835864 + "lastSeen": 1747929835864 }, { - "id": { - "id": "PR_kwDOMJIfts6XY-mZ", - "number": 119 + "id": { + "id": "PR_kwDOMJIfts6XY-mZ", + "number": 119 }, - "lastSeen": 1748028108508 + "lastSeen": 1748028108508 }, { - "id": { - "id": "PR_kwDOMJIfts6Xdz4n", - "number": 120 + "id": { + "id": "PR_kwDOMJIfts6Xdz4n", + "number": 120 }, - "lastSeen": 1748282672214 + "lastSeen": 1748282672214 } ] -}]]> +} { "selectedUrlAndAccountId": { "url": "https://github.com/iib0011/omni-tools.git", @@ -211,7 +211,7 @@ "Vitest.replaceText function (regexp mode).should return the original text when passed an invalid regexp.executor": "Run", "Vitest.replaceText function.executor": "Run", "Vitest.timeBetweenDates.executor": "Run", - "git-widget-placeholder": "#120 on chesterkxng", + "git-widget-placeholder": "#131 on fork/ARRY7686/main", "ignore.virus.scanning.warn.message": "true", "kotlin-language-version-configured": "true", "last_opened_file_path": "C:/Users/Ibrahima/IdeaProjects/omni-tools/src", diff --git a/src/components/ToolContent.tsx b/src/components/ToolContent.tsx index 703128e..9e261ae 100644 --- a/src/components/ToolContent.tsx +++ b/src/components/ToolContent.tsx @@ -38,25 +38,25 @@ const FormikListenerComponent = ({ return null; // This component doesn't render anything }; -interface ToolContentProps extends ToolComponentProps { +interface ToolContentProps extends ToolComponentProps { inputComponent?: ReactNode; resultComponent?: ReactNode; renderCustomInput?: ( - values: T, + values: Options, setFieldValue: (fieldName: string, value: any) => void ) => ReactNode; - initialValues: T; - getGroups: GetGroupsType | null; - compute: (optionsValues: T, input: I) => void; + initialValues: Options; + getGroups: GetGroupsType | null; + compute: (optionsValues: Options, input: Input) => void; toolInfo?: { title: string; description?: string; }; - input?: I; - exampleCards?: CardExampleType[]; - setInput?: React.Dispatch>; + input?: Input; + exampleCards?: CardExampleType[]; + setInput?: React.Dispatch>; validationSchema?: any; - onValuesChange?: (values: T) => void; + onValuesChange?: (values: Options) => void; verticalGroups?: boolean; } diff --git a/src/pages/tools/pdf/pdf-to-epub/index.tsx b/src/pages/tools/pdf/pdf-to-epub/index.tsx index 4a8a50d..952a716 100644 --- a/src/pages/tools/pdf/pdf-to-epub/index.tsx +++ b/src/pages/tools/pdf/pdf-to-epub/index.tsx @@ -10,13 +10,12 @@ export default function PdfToEpub({ title }: ToolComponentProps) { const [result, setResult] = useState(null); const [isProcessing, setIsProcessing] = useState(false); - const compute = async (files: File[]) => { - if (!files?.[0]) return; - + const compute = async (options: {}, input: File | null) => { + if (!input) return; try { setIsProcessing(true); setResult(null); - const epub = await convertPdfToEpub(files[0]); + const epub = await convertPdfToEpub(input); setResult(epub); } catch (error) { console.error('Failed to convert PDF to EPUB:', error); @@ -25,18 +24,12 @@ export default function PdfToEpub({ title }: ToolComponentProps) { } }; - useEffect(() => { - if (input) { - compute([input]); - } - }, [input]); - return (