dify/web/app/components/workflow/block-selector/hooks.ts
2024-03-05 11:57:51 +08:00

14 lines
276 B
TypeScript

import { useTranslation } from 'react-i18next'
import { BLOCKS } from './constants'
export const useBlocks = () => {
const { t } = useTranslation()
return BLOCKS.map((block) => {
return {
...block,
title: t(`workflow.blocks.${block.type}`),
}
})
}