import React from 'react'; import Immutable from 'immutable'; import ControlPane from './ControlPane'; import PreviewPane from './PreviewPane'; export default class EntryEditor extends React.Component { constructor(props) { super(props); this.state = { entry: props.entry, mediaFiles: Immutable.List() }; this.handleChange = this.handleChange.bind(this); this.handleAddMedia = this.handleAddMedia.bind(this); this.handleSave = this.handleSave.bind(this); } handleChange(entry) { this.setState({entry: entry}); } handleAddMedia(mediaFile) { this.setState({mediaFiles: this.state.mediaFiles.push(mediaFile)}); } handleSave() { this.props.onPersist(this.state.entry, this.state.mediaFiles); } render() { const { collection, entry } = this.props; return