import ComposerBody from 'flarum/components/ComposerBody'; /** * The `DiscussionComposer` component displays the composer content for starting * a new discussion. It adds a text field as a header control so the user can * enter the title of their discussion. It also overrides the `submit` and * `willExit` actions to account for the title. * * ### Props * * - All of the props for ComposerBody * - `titlePlaceholder` */ export default class DiscussionComposer extends ComposerBody { constructor(...args) { super(...args); /** * The value of the title input. * * @type {Function} */ this.title = m.prop(''); } static initProps(props) { super.initProps(props); props.placeholder = props.placeholder || app.trans('core.composer_discussion_body_placeholder'); props.submitLabel = props.submitLabel || app.trans('core.composer_discussion_submit_button'); props.confirmExit = props.confirmExit || app.trans('core.composer_discussion_discard_confirmation'); props.titlePlaceholder = props.titlePlaceholder || app.trans('core.composer_discussion_title_placeholder'); } headerItems() { const items = super.headerItems(); items.add('title', (