dify/web/app/components/workflow/nodes/start-placeholder/node.tsx
Stephen Zhou b9fde89781
refactor(web): migrate i18n to selector optimize mode (#38657)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-10 09:35:31 +00:00

26 lines
747 B
TypeScript

import type { FC } from 'react'
import type { NodeProps } from '@/app/components/workflow/types'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
const i18nPrefix = 'nodes.startPlaceholder'
const Node: FC<NodeProps> = ({
data,
}) => {
const { t } = useTranslation()
const descriptionKey = data.selected ? 'nodeDescription' : 'nodeCollapsedDescription'
return (
<div className="px-2.5 py-1">
<div className="rounded-md bg-workflow-block-parma-bg px-1.5 py-[5px]">
<div className="system-xs-regular wrap-break-word text-text-tertiary">
{t($ => $[`${i18nPrefix}.${descriptionKey}`], { ns: 'workflow' })}
</div>
</div>
</div>
)
}
export default React.memo(Node)