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: