Files
omni-tools/src/pages/tools/number/generic-calc/meta.ts
Ibrahima G. Coulibaly 6310fbdc0e chore: use full meta init
2025-04-17 08:03:18 +01:00

33 lines
865 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', {
name: x.name,
path: 'generic-calc/' + x.path,
icon: x.icon || '',
description: x.description || '',
shortDescription: x.description || '',
keywords: ['calculator', 'math', ...x.keywords],
longDescription: x.longDescription || '',
component: lazy(importComponent2)
})
);
});
export { tools };