/* eslint-disable react/no-multi-comp */ import * as React from 'react'; import {gettext} from 'core/utils'; import {Modal} from 'core/ui/components/Modal/Modal'; import {ModalBody} from 'core/ui/components/Modal/ModalBody'; import {ModalHeader} from 'core/ui/components/Modal/ModalHeader'; import {ModalFooter} from 'core/ui/components/Modal/ModalFooter'; import {Label} from 'core/ui/components/Form/Label'; import {Input} from 'core/ui/components/Form/Input'; import {TextArea} from 'core/ui/components/Form/TextArea'; import {IAttachment} from 'superdesk-api'; interface IProps { attachment: IAttachment; saveAttachment: (original: IAttachment, updates: Partial) => void; closeEdit: () => void; } type IState = Partial; export class AttachmentsEditorModal extends React.Component { constructor(props) { super(props); this.state = {title: props.attachment.title, description: props.attachment.description}; this.update = this.update.bind(this); } update(key: string, val: string) { const updates = {}; updates[key] = val; this.setState(updates); } render() { return ( {gettext('Edit Attachment')}