import React from 'react'; import { Form, Alert } from 'antd'; import MarkdownEditor from 'components/MarkdownEditor'; import { ProposalDraft } from 'types'; import { getCreateErrors } from 'modules/create/utils'; interface State { content: string; } interface Props { initialState?: Partial; updateForm(form: Partial): void; } export default class CreateFlowTeam extends React.Component { constructor(props: Props) { super(props); this.state = { content: '', ...(props.initialState || {}), }; } render() { const errors = getCreateErrors(this.state, true); return (
{errors.content && } ); } private handleChange = (markdown: string) => { if (markdown !== this.state.content) { this.setState({ content: markdown }, () => { this.props.updateForm(this.state); }); } }; }