您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

excel-to-html-form-field.tsx 854B

12345678910111213141516171819202122232425262728293031323334
  1. import { useTranslate } from '@/hooks/common-hooks';
  2. import { useFormContext } from 'react-hook-form';
  3. import {
  4. FormControl,
  5. FormField,
  6. FormItem,
  7. FormLabel,
  8. FormMessage,
  9. } from './ui/form';
  10. import { Switch } from './ui/switch';
  11. export function ExcelToHtmlFormField() {
  12. const form = useFormContext();
  13. const { t } = useTranslate('knowledgeDetails');
  14. return (
  15. <FormField
  16. control={form.control}
  17. name="parser_config.html4excel"
  18. render={({ field }) => (
  19. <FormItem defaultChecked={false}>
  20. <FormLabel tooltip={t('html4excelTip')}>{t('html4excel')}</FormLabel>
  21. <FormControl>
  22. <Switch
  23. checked={field.value}
  24. onCheckedChange={field.onChange}
  25. ></Switch>
  26. </FormControl>
  27. <FormMessage />
  28. </FormItem>
  29. )}
  30. />
  31. );
  32. }