dify/web/app/components/base/prompt-editor/plugins/placeholder.tsx
Stephen Zhou a26881cb24
refactor: unified cn utils (#29916)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2025-12-19 12:08:34 +08:00

29 lines
672 B
TypeScript

import { memo } from 'react'
import type { ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
import { cn } from '@/utils/classnames'
const Placeholder = ({
compact,
value,
className,
}: {
compact?: boolean
value?: ReactNode
className?: string
}) => {
const { t } = useTranslation()
return (
<div className={cn(
'pointer-events-none absolute left-0 top-0 h-full w-full select-none text-sm text-components-input-text-placeholder',
compact ? 'text-[13px] leading-5' : 'text-sm leading-6',
className,
)}>
{value || t('common.promptEditor.placeholder')}
</div>
)
}
export default memo(Placeholder)