import { h } from 'preact'; import PropTypes from 'prop-types'; import { EditorBody } from './EditorBody'; import { Meta } from './Meta'; import { ErrorList } from './ErrorList'; export const Form = ({ titleDefaultValue, titleOnChange, tagsDefaultValue, tagsOnInput, bodyDefaultValue, bodyOnChange, bodyHasFocus, version, mainImage, onMainImageUrlChange, switchHelpContext, errors, }) => { return (
{errors && } {version === 'v2' && ( )}
); }; Form.propTypes = { titleDefaultValue: PropTypes.string.isRequired, titleOnChange: PropTypes.func.isRequired, tagsDefaultValue: PropTypes.string.isRequired, tagsOnInput: PropTypes.func.isRequired, bodyDefaultValue: PropTypes.string.isRequired, bodyOnChange: PropTypes.func.isRequired, bodyHasFocus: PropTypes.bool.isRequired, version: PropTypes.string.isRequired, mainImage: PropTypes.string, onMainImageUrlChange: PropTypes.func.isRequired, switchHelpContext: PropTypes.func.isRequired, errors: PropTypes.object, }; Form.displayName = 'Form';