loopback.tsx 900 B

12345678910111213141516171819202122232425262728293031
  1. import { useTranslation } from 'react-i18next';
  2. import { Input } from 'antd';
  3. import { Controller, useFormContext } from 'react-hook-form';
  4. import { FormField } from '@/components/form/rhf';
  5. import { SniffingField } from '@/lib/xray/forms/fields';
  6. export default function LoopbackFields() {
  7. const { t } = useTranslation();
  8. const { control } = useFormContext();
  9. return (
  10. <>
  11. <FormField label={t('pages.xray.outboundForm.inboundTag')} name={['settings', 'inboundTag']}>
  12. <Input placeholder={t('pages.xray.outboundForm.inboundTagPlaceholder')} />
  13. </FormField>
  14. <Controller
  15. control={control}
  16. name="settings.sniffing"
  17. render={({ field }) => (
  18. <SniffingField
  19. value={field.value}
  20. onChange={field.onChange}
  21. enableLabel={t('pages.inbounds.sniffingTab')}
  22. />
  23. )}
  24. />
  25. </>
  26. );
  27. }