mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
service
This commit is contained in:
13
web/app/components/workflow/block-selector/hooks.ts
Normal file
13
web/app/components/workflow/block-selector/hooks.ts
Normal file
@ -0,0 +1,13 @@
|
||||
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}`),
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user