Files
omni-tools/src/pages/tools/number/generic-calc/meta.ts
Ibrahima G. Coulibaly 1cc774e75d fix: misc
2025-04-17 08:22:21 +01:00

29 lines
698 B
TypeScript

import { DefinedTool, defineTool } from '@tools/defineTool';
import { lazy } from 'react';
import type { GenericCalcType } from './data/types';
import allGenericCalcs from './data/index';
async function importComponent(data: GenericCalcType) {
const x = await import('./index');
return { default: await x.default(data) };
}
const tools: DefinedTool[] = [];
allGenericCalcs.forEach((x) => {
async function importComponent2() {
return await importComponent(x);
}
tools.push(
defineTool('number', {
...x,
path: 'generic-calc/' + x.path,
keywords: ['calculator', 'math', ...x.keywords],
component: lazy(importComponent2)
})
);
});
export { tools };