import {Component, Fragment} from 'react'; import {ModalRenderProps} from 'sentry/actionCreators/modal'; import {Client} from 'sentry/api'; import SentryAppExternalIssueForm from 'sentry/components/group/sentryAppExternalIssueForm'; import NavTabs from 'sentry/components/navTabs'; import {t, tct} from 'sentry/locale'; import { Group, PlatformExternalIssue, SentryAppComponent, SentryAppInstallation, } from 'sentry/types'; import {Event} from 'sentry/types/event'; import withApi from 'sentry/utils/withApi'; type Props = ModalRenderProps & { api: Client; event: Event; group: Group; onSubmitSuccess: (externalIssue: PlatformExternalIssue) => void; sentryAppComponent: SentryAppComponent; sentryAppInstallation: SentryAppInstallation; }; type State = { action: 'create' | 'link'; }; class SentryAppExternalIssueModal extends Component { state: State = { action: 'create', }; showLink = () => { this.setState({action: 'link'}); }; showCreate = () => { this.setState({action: 'create'}); }; onSubmitSuccess = (externalIssue: PlatformExternalIssue) => { this.props.onSubmitSuccess(externalIssue); this.props.closeModal(); }; render() { const {Header, Body, sentryAppComponent, sentryAppInstallation, group} = this.props; const {action} = this.state; const name = sentryAppComponent.sentryApp.name; const config = sentryAppComponent.schema[action]; return (
{tct('[name] Issue', {name})}
  • {t('Create')}
  • {t('Link')}
  • ); } } export default withApi(SentryAppExternalIssueModal);