import React, { useRef } from 'react'; import { connect } from 'react-redux'; import { edit, save } from 'Duck/customField'; import { Form, Input, Button } from 'UI'; import styles from './customFieldForm.module.css'; const CustomFieldForm = ({ field, saving, errors, edit, save, onSave, onClose, onDelete }) => { const focusElementRef = useRef(null); const setFocus = () => focusElementRef.current.focus(); const onChangeSelect = (event, { name, value }) => edit({ [name]: value }); const write = ({ target: { value, name } }) => edit({ [name]: value }); const exists = field.exists(); return (