import type { Ref } from 'react' import type { AgentFormValues, AgentIconSelection } from './agent-form' import { Field, FieldError, FieldLabel } from '@langgenius/dify-ui/field' import { Input } from '@langgenius/dify-ui/input' import { Textarea } from '@langgenius/dify-ui/textarea' import { useTranslation } from 'react-i18next' import AppIcon from '@/app/components/base/app-icon' type AgentFormFieldsProps = { defaultValues: AgentFormValues icon: AgentIconSelection iconAriaLabel: string onIconClick: () => void ref: Ref } export function AgentFormFields({ defaultValues, icon, iconAriaLabel, onIconClick, ref, }: AgentFormFieldsProps) { const { t } = useTranslation('agentV2') const { t: tCommon } = useTranslation('common') return (
{ if (typeof value === 'string' && value.length > 0 && !value.trim()) return t(($) => $['roster.createForm.nameRequired']) return null }} > {t(($) => $['roster.createForm.nameLabel'])} $['roster.createForm.namePlaceholder'])} required /> {t(($) => $['roster.createForm.nameRequired'])} {t(($) => $['roster.createForm.roleLabel'])} {tCommon(($) => $['label.optional'])} $['roster.createForm.rolePlaceholder'])} />
{t(($) => $['roster.createForm.descriptionLabel'])} {tCommon(($) => $['label.optional'])}