diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e95cf2d..3f79c3d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,12 @@
-
+
-
+
+
+
+
@@ -20,7 +23,7 @@
@@ -39,164 +42,171 @@
"state": "OPEN"
}
}
- {
- "prStates": [
+
+}]]>
{
"selectedUrlAndAccountId": {
"url": "https://github.com/iib0011/omni-tools.git",
@@ -228,56 +238,56 @@
- {
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
- "Docker.Dockerfile build.executor": "Run",
- "Docker.Dockerfile.executor": "Run",
- "Playwright.Create transparent PNG.should make png color transparent.executor": "Run",
- "Playwright.JoinText Component.executor": "Run",
- "Playwright.JoinText Component.should merge text pieces with specified join character.executor": "Run",
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.git.unshallow": "true",
- "Vitest.compute function (1).executor": "Run",
- "Vitest.compute function.executor": "Run",
- "Vitest.mergeText.executor": "Run",
- "Vitest.mergeText.should merge lines and preserve blank lines when deleteBlankLines is false.executor": "Run",
- "Vitest.mergeText.should merge lines, preserve blank lines and trailing spaces when both deleteBlankLines and deleteTrailingSpaces are false.executor": "Run",
- "Vitest.parsePageRanges.executor": "Run",
- "Vitest.removeDuplicateLines function.executor": "Run",
- "Vitest.removeDuplicateLines function.newlines option.executor": "Run",
- "Vitest.removeDuplicateLines function.newlines option.should filter newlines when newlines is set to filter.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.timeBetweenDates.executor": "Run",
- "git-widget-placeholder": "main",
- "ignore.virus.scanning.warn.message": "true",
- "kotlin-language-version-configured": "true",
- "last_opened_file_path": "C:/Users/Ibrahima/IdeaProjects/omni-tools/public",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "npm.build.executor": "Run",
- "npm.dev.executor": "Run",
- "npm.lint.executor": "Run",
- "npm.prebuild.executor": "Run",
- "npm.script:create:tool.executor": "Run",
- "npm.test.executor": "Run",
- "npm.test:e2e.executor": "Run",
- "npm.test:e2e:run.executor": "Run",
- "prettierjs.PrettierConfiguration.Package": "C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\prettier",
- "project.structure.last.edited": "Problems",
- "project.structure.proportion": "0.0",
- "project.structure.side.proportion": "0.2",
- "settings.editor.selected.configurable": "refactai_advanced_settings",
- "ts.external.directory.path": "C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\typescript\\lib",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -491,31 +501,9 @@
-
-
-
-
- 1742967844908
-
-
-
- 1742967844908
-
-
-
- 1743019312699
-
-
-
- 1743019312699
-
-
-
- 1743020690384
-
-
-
- 1743020690384
+
+
+
@@ -885,7 +873,31 @@
1752079879005
-
+
+
+ 1752080307348
+
+
+
+ 1752080307349
+
+
+
+ 1752157851370
+
+
+
+ 1752157851371
+
+
+
+ 1752158119802
+
+
+
+ 1752158119802
+
+
@@ -932,9 +944,6 @@
-
-
-
@@ -957,7 +966,10 @@
-
+
+
+
+
false
diff --git a/src/components/ToolContent.tsx b/src/components/ToolContent.tsx
index 9e261ae..093b2d8 100644
--- a/src/components/ToolContent.tsx
+++ b/src/components/ToolContent.tsx
@@ -46,6 +46,9 @@ interface ToolContentProps extends ToolComponentProps {
setFieldValue: (fieldName: string, value: any) => void
) => ReactNode;
initialValues: Options;
+ /**
+ * should return non-empty array or null
+ */
getGroups: GetGroupsType | null;
compute: (optionsValues: Options, input: Input) => void;
toolInfo?: {
diff --git a/src/components/options/ToolOptions.tsx b/src/components/options/ToolOptions.tsx
index c145fca..b08d42a 100644
--- a/src/components/options/ToolOptions.tsx
+++ b/src/components/options/ToolOptions.tsx
@@ -6,10 +6,10 @@ import { FormikProps, FormikValues, useFormikContext } from 'formik';
import ToolOptionGroups, { ToolOptionGroup } from './ToolOptionGroups';
export type UpdateField = (field: Y, value: T[Y]) => void;
-
+type NonEmptyArray = [T, ...T[]];
export type GetGroupsType = (
formikProps: FormikProps & { updateField: UpdateField }
-) => ToolOptionGroup[];
+) => NonEmptyArray;
export default function ToolOptions({
children,
@@ -50,7 +50,7 @@ export default function ToolOptions({
{children}
diff --git a/src/pages/tools/number/generic-calc/index.tsx b/src/pages/tools/number/generic-calc/index.tsx
index 4363900..99ba5a2 100644
--- a/src/pages/tools/number/generic-calc/index.tsx
+++ b/src/pages/tools/number/generic-calc/index.tsx
@@ -240,6 +240,7 @@ export default async function makeTool(
description: calcData.longDescription
}}
verticalGroups
+ // @ts-ignore
getGroups={({ values, updateField }) => [
...(calcData.presets?.length
? [
diff --git a/src/pages/tools/time/check-leap-years/index.tsx b/src/pages/tools/time/check-leap-years/index.tsx
index af14d8d..99672bd 100644
--- a/src/pages/tools/time/check-leap-years/index.tsx
+++ b/src/pages/tools/time/check-leap-years/index.tsx
@@ -63,7 +63,7 @@ export default function ConvertDaysToHours({
setResult(checkLeapYear(input));
};
- const getGroups: GetGroupsType | null = () => [];
+ const getGroups: GetGroupsType | null = null;
return (