feat: translate graph and chat text (#1433)

translate graph and chat text
This commit is contained in:
Song Yeung
2024-07-09 10:43:52 +08:00
committed by GitHub
parent 427fb97562
commit 24f9b17ff6
12 changed files with 67 additions and 17 deletions

View File

@ -1,13 +1,15 @@
import { useTranslate } from '@/hooks/commonHooks';
import { Flex } from 'antd';
import classNames from 'classnames';
import lowerFirst from 'lodash/lowerFirst';
import { Handle, NodeProps, Position } from 'reactflow';
import { Operator, operatorMap } from '../../constant';
import { NodeData } from '../../interface';
import styles from './index.less';
// TODO: do not allow other nodes to connect to this node
export function BeginNode({ id, data, selected }: NodeProps<NodeData>) {
const { t } = useTranslate('flow');
return (
<section
className={classNames(styles.ragNode, {
@ -27,7 +29,7 @@ export function BeginNode({ id, data, selected }: NodeProps<NodeData>) {
className={styles.handle}
></Handle>
<Flex vertical align="center" justify="center" gap={6}>
<span className={styles.type}>{data.label}</span>
<span className={styles.type}>{t(lowerFirst(data.label))}</span>
</Flex>
<section className={styles.bottomBox}>
<div className={styles.nodeName}>{data.name}</div>