import {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 space from 'sentry/styles/space'; import type {Commit, ResolutionStatusDetails} from 'sentry/types'; interface CustomCommitsResolutionModalProps extends ModalRenderProps { onSelected: (x: ResolutionStatusDetails) => void; orgSlug: string; projectSlug?: string; } function CustomCommitsResolutionModal({ onSelected, orgSlug, projectSlug, closeModal, Header, Body, Footer, }: CustomCommitsResolutionModalProps) { const [commit, setCommit] = useState(); const [commits, setCommits] = useState(); const onChange = (value: string | number | boolean) => { setCommit(commits?.find(result => result.id === value)); }; const onAsyncFieldResults = (results: Commit[]) => { setCommits(results); return results.map(c => ({ value: c.id, label: , details: ( {t('Created')} ), c, })); }; const onSubmit = (e: React.FormEvent) => { e.preventDefault(); onSelected({ inCommit: { commit: commit?.id, repository: commit?.repository?.name, }, }); closeModal(); }; return (

{t('Resolved In')}

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