import {Fragment, useState} from 'react'; import type {ModalRenderProps} from 'sentry/actionCreators/modal'; import Button from 'sentry/components/button'; import SelectAsyncField from 'sentry/components/deprecatedforms/selectAsyncField'; import TimeSince from 'sentry/components/timeSince'; import Version from 'sentry/components/version'; import {t} from 'sentry/locale'; import configStore from 'sentry/stores/configStore'; import space from 'sentry/styles/space'; import type {Release} from 'sentry/types'; interface CustomResolutionModalProps extends ModalRenderProps { onSelected: (change: {inRelease: string}) => void; orgSlug: string; projectSlug?: string; } function CustomResolutionModal(props: CustomResolutionModalProps) { const [version, setVersion] = useState(''); const currentUser = configStore.get('user'); const onChange = (value: any) => { setVersion(value.item); }; const onAsyncFieldResults = (results: Release[]) => { return results.map(release => { const isAuthor = release.authors.some( author => author.email && author.email === currentUser?.email ); return { item: release.version, label: , details: ( {t('Created')} {isAuthor ? — {t('You committed')} : null} ), release, }; }); }; const url = props.projectSlug ? `/projects/${props.orgSlug}/${props.projectSlug}/releases/` : `/organizations/${props.orgSlug}/releases/`; const onSubmit = (e: React.FormEvent) => { e.preventDefault(); props.onSelected({inRelease: version}); props.closeModal(); }; const {Header, Body, Footer} = props; return (

{t('Resolved In')}

({query})} /> ); } export default CustomResolutionModal;