mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
fix: compute flow
This commit is contained in:
142
.idea/workspace.xml
generated
142
.idea/workspace.xml
generated
@@ -6,8 +6,8 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="chore: remove unnecessary prop">
|
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="chore: remove unnecessary prop">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/components/options/TextareaWithDesc.tsx" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/components/ToolContent.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/ToolContent.tsx" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/pages/tools/csv/insert-csv-columns/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/tools/csv/insert-csv-columns/index.tsx" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/pages/tools/pdf/pdf-to-epub/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/tools/pdf/pdf-to-epub/index.tsx" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<option name="PUSH_AUTO_UPDATE" value="true" />
|
<option name="PUSH_AUTO_UPDATE" value="true" />
|
||||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||||
<map>
|
<map>
|
||||||
<entry key="$PROJECT_DIR$" value="main" />
|
<entry key="$PROJECT_DIR$" value="chesterkxng" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
@@ -43,122 +43,122 @@
|
|||||||
"state": "OPEN"
|
"state": "OPEN"
|
||||||
}
|
}
|
||||||
}</component>
|
}</component>
|
||||||
<component name="GitHubPullRequestState"><![CDATA[{
|
<component name="GitHubPullRequestState">{
|
||||||
"prStates": [
|
"prStates": [
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts51PkS9",
|
"id": "PR_kwDOMJIfts51PkS9",
|
||||||
"number": 22
|
"number": 22
|
||||||
},
|
},
|
||||||
"lastSeen": 1741207144695
|
"lastSeen": 1741207144695
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6NiNYl",
|
"id": "PR_kwDOMJIfts6NiNYl",
|
||||||
"number": 32
|
"number": 32
|
||||||
},
|
},
|
||||||
"lastSeen": 1741209723869
|
"lastSeen": 1741209723869
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6Nheyd",
|
"id": "PR_kwDOMJIfts6Nheyd",
|
||||||
"number": 31
|
"number": 31
|
||||||
},
|
},
|
||||||
"lastSeen": 1741213371410
|
"lastSeen": 1741213371410
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6NmRBs",
|
"id": "PR_kwDOMJIfts6NmRBs",
|
||||||
"number": 33
|
"number": 33
|
||||||
},
|
},
|
||||||
"lastSeen": 1741282429036
|
"lastSeen": 1741282429036
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts5zyFTs",
|
"id": "PR_kwDOMJIfts5zyFTs",
|
||||||
"number": 15
|
"number": 15
|
||||||
},
|
},
|
||||||
"lastSeen": 1741535540953
|
"lastSeen": 1741535540953
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6QQB3c",
|
"id": "PR_kwDOMJIfts6QQB3c",
|
||||||
"number": 59
|
"number": 59
|
||||||
},
|
},
|
||||||
"lastSeen": 1743018960900
|
"lastSeen": 1743018960900
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6QMPEg",
|
"id": "PR_kwDOMJIfts6QMPEg",
|
||||||
"number": 58
|
"number": 58
|
||||||
},
|
},
|
||||||
"lastSeen": 1743019452983
|
"lastSeen": 1743019452983
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6QZvRI",
|
"id": "PR_kwDOMJIfts6QZvRI",
|
||||||
"number": 61
|
"number": 61
|
||||||
},
|
},
|
||||||
"lastSeen": 1743103196866
|
"lastSeen": 1743103196866
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6QqPrQ",
|
"id": "PR_kwDOMJIfts6QqPrQ",
|
||||||
"number": 73
|
"number": 73
|
||||||
},
|
},
|
||||||
"lastSeen": 1743265865001
|
"lastSeen": 1743265865001
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6Qp5nI",
|
"id": "PR_kwDOMJIfts6Qp5nI",
|
||||||
"number": 72
|
"number": 72
|
||||||
},
|
},
|
||||||
"lastSeen": 1743338472110
|
"lastSeen": 1743338472110
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6QsjlS",
|
"id": "PR_kwDOMJIfts6QsjlS",
|
||||||
"number": 76
|
"number": 76
|
||||||
},
|
},
|
||||||
"lastSeen": 1743352150953
|
"lastSeen": 1743352150953
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6Q0JBe",
|
"id": "PR_kwDOMJIfts6Q0JBe",
|
||||||
"number": 82
|
"number": 82
|
||||||
},
|
},
|
||||||
"lastSeen": 1743470267269
|
"lastSeen": 1743470267269
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6UE9-x",
|
"id": "PR_kwDOMJIfts6UE9-x",
|
||||||
"number": 102
|
"number": 102
|
||||||
},
|
},
|
||||||
"lastSeen": 1747171977348
|
"lastSeen": 1747171977348
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6XPua_",
|
"id": "PR_kwDOMJIfts6XPua_",
|
||||||
"number": 117
|
"number": 117
|
||||||
},
|
},
|
||||||
"lastSeen": 1747929835864
|
"lastSeen": 1747929835864
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6XY-mZ",
|
"id": "PR_kwDOMJIfts6XY-mZ",
|
||||||
"number": 119
|
"number": 119
|
||||||
},
|
},
|
||||||
"lastSeen": 1748028108508
|
"lastSeen": 1748028108508
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": {
|
"id": {
|
||||||
"id": "PR_kwDOMJIfts6Xdz4n",
|
"id": "PR_kwDOMJIfts6Xdz4n",
|
||||||
"number": 120
|
"number": 120
|
||||||
},
|
},
|
||||||
"lastSeen": 1748282672214
|
"lastSeen": 1748282672214
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="GithubPullRequestsUISettings">{
|
<component name="GithubPullRequestsUISettings">{
|
||||||
"selectedUrlAndAccountId": {
|
"selectedUrlAndAccountId": {
|
||||||
"url": "https://github.com/iib0011/omni-tools.git",
|
"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 (regexp mode).should return the original text when passed an invalid regexp.executor": "Run",
|
||||||
"Vitest.replaceText function.executor": "Run",
|
"Vitest.replaceText function.executor": "Run",
|
||||||
"Vitest.timeBetweenDates.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",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "C:/Users/Ibrahima/IdeaProjects/omni-tools/src",
|
"last_opened_file_path": "C:/Users/Ibrahima/IdeaProjects/omni-tools/src",
|
||||||
|
@@ -38,25 +38,25 @@ const FormikListenerComponent = <T,>({
|
|||||||
return null; // This component doesn't render anything
|
return null; // This component doesn't render anything
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ToolContentProps<T, I> extends ToolComponentProps {
|
interface ToolContentProps<Options, Input> extends ToolComponentProps {
|
||||||
inputComponent?: ReactNode;
|
inputComponent?: ReactNode;
|
||||||
resultComponent?: ReactNode;
|
resultComponent?: ReactNode;
|
||||||
renderCustomInput?: (
|
renderCustomInput?: (
|
||||||
values: T,
|
values: Options,
|
||||||
setFieldValue: (fieldName: string, value: any) => void
|
setFieldValue: (fieldName: string, value: any) => void
|
||||||
) => ReactNode;
|
) => ReactNode;
|
||||||
initialValues: T;
|
initialValues: Options;
|
||||||
getGroups: GetGroupsType<T> | null;
|
getGroups: GetGroupsType<Options> | null;
|
||||||
compute: (optionsValues: T, input: I) => void;
|
compute: (optionsValues: Options, input: Input) => void;
|
||||||
toolInfo?: {
|
toolInfo?: {
|
||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
};
|
};
|
||||||
input?: I;
|
input?: Input;
|
||||||
exampleCards?: CardExampleType<T>[];
|
exampleCards?: CardExampleType<Options>[];
|
||||||
setInput?: React.Dispatch<React.SetStateAction<I>>;
|
setInput?: React.Dispatch<React.SetStateAction<Input>>;
|
||||||
validationSchema?: any;
|
validationSchema?: any;
|
||||||
onValuesChange?: (values: T) => void;
|
onValuesChange?: (values: Options) => void;
|
||||||
verticalGroups?: boolean;
|
verticalGroups?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,13 +10,12 @@ export default function PdfToEpub({ title }: ToolComponentProps) {
|
|||||||
const [result, setResult] = useState<File | null>(null);
|
const [result, setResult] = useState<File | null>(null);
|
||||||
const [isProcessing, setIsProcessing] = useState<boolean>(false);
|
const [isProcessing, setIsProcessing] = useState<boolean>(false);
|
||||||
|
|
||||||
const compute = async (files: File[]) => {
|
const compute = async (options: {}, input: File | null) => {
|
||||||
if (!files?.[0]) return;
|
if (!input) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setIsProcessing(true);
|
setIsProcessing(true);
|
||||||
setResult(null);
|
setResult(null);
|
||||||
const epub = await convertPdfToEpub(files[0]);
|
const epub = await convertPdfToEpub(input);
|
||||||
setResult(epub);
|
setResult(epub);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to convert PDF to EPUB:', 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 (
|
return (
|
||||||
<ToolContent
|
<ToolContent
|
||||||
title={title}
|
title={title}
|
||||||
input={input}
|
input={input}
|
||||||
setInput={setInput}
|
setInput={setInput}
|
||||||
initialValues={input ? [input] : []}
|
initialValues={{}}
|
||||||
compute={compute}
|
compute={compute}
|
||||||
inputComponent={
|
inputComponent={
|
||||||
<ToolPdfInput
|
<ToolPdfInput
|
||||||
|
Reference in New Issue
Block a user