feat: translate name of operator #918 (#1437)

### What problem does this PR solve?

feat: translate name of operator #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-07-09 13:22:37 +08:00
committed by GitHub
parent 56e3fa2d6a
commit 198a8b6592
7 changed files with 27 additions and 30 deletions

View File

@ -1,4 +1,3 @@
import { useTranslate } from '@/hooks/commonHooks';
import { ResponseType } from '@/interfaces/database/base';
import { DSL, IFlow, IFlowTemplate } from '@/interfaces/database/flow';
import i18n from '@/locales/config';
@ -46,7 +45,6 @@ export const EmptyDsl = {
};
export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
const { t } = useTranslate('flow');
const { data } = useQuery({
queryKey: ['fetchFlowTemplates'],
initialData: [],
@ -55,8 +53,8 @@ export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
if (Array.isArray(data?.data)) {
data.data.unshift({
id: uuid(),
title: t('blank'),
description: t('createFromNothing'),
title: 'Blank',
description: 'Create from nothing',
dsl: EmptyDsl,
});
}