// @flow import React, { Component } from 'react'; import { Layout, Container, Header } from './Layout'; import ExternalLinkSVG from '../assets/images/icon-extLink.svg'; export type SupportReport = { email: string, description: string }; export type SupportState = SupportReport; export type SupportProps = { onClose: () => void; onViewLogs: () => void; onSend: (report: SupportReport) => void; }; export default class Support extends Component { props: SupportProps; state: SupportState = { email: '', description: '' } validate() { return this.state.description.trim().length > 0; } onChangeEmail = (e: Event) => { const input = e.target; if(!(input instanceof HTMLInputElement)) { throw new Error('input must be an instance of HTMLInputElement'); } this.setState({ email: input.value }); } onChangeDescription = (e: Event) => { const input = e.target; if(!(input instanceof HTMLTextAreaElement)) { throw new Error('input must be an instance of HTMLTextAreaElement'); } this.setState({ description: input.value }); } onSend = () => { this.props.onSend(this.state); } render() { return (