mirror of
https://github.com/CorentinTh/it-tools.git
synced 2026-02-25 12:09:59 -05:00
20 lines
497 B
TypeScript
20 lines
497 B
TypeScript
import { createMemo } from 'solid-js';
|
|
import { useI18n } from '../i18n/i18n.provider';
|
|
import { toolDefinitions } from './tools.registry';
|
|
|
|
export { useToolsStore };
|
|
|
|
function useToolsStore() {
|
|
const { t } = useI18n();
|
|
|
|
const getTools = createMemo(() => toolDefinitions.map((tool) => {
|
|
return {
|
|
...tool,
|
|
name: t(`tools.${tool.slug}.name` as any) ?? tool.slug,
|
|
description: t(`tools.${tool.slug}.description` as any) ?? tool.slug,
|
|
};
|
|
}));
|
|
|
|
return { getTools };
|
|
}
|