import type { EducationRole } from './types' import { Field, FieldItem, FieldLabel } from '@langgenius/dify-ui/field' import { Fieldset, FieldsetLegend } from '@langgenius/dify-ui/fieldset' import { Radio, RadioGroup } from '@langgenius/dify-ui/radio-group' import { useTranslation } from 'react-i18next' type RoleSelectorProps = { onChange: (value: EducationRole) => void value: EducationRole } const RoleSelector = ({ onChange, value }: RoleSelectorProps) => { const { t } = useTranslation() const options: { key: EducationRole; value: string }[] = [ { key: 'Student', value: t(($) => $['form.schoolRole.option.student'], { ns: 'education' }), }, { key: 'Teacher', value: t(($) => $['form.schoolRole.option.teacher'], { ns: 'education' }), }, { key: 'School-Administrator', value: t(($) => $['form.schoolRole.option.administrator'], { ns: 'education' }), }, ] return (
className="gap-6" value={value} onValueChange={onChange} /> } > {t(($) => $['form.schoolRole.title'], { ns: 'education' })} {options.map((option) => ( value={option.key} /> {option.value} ))}
) } export default RoleSelector