import React from 'react'; import Alert from '../../Common/Alert'; import Modal from '../../Common/Modal'; import { SmallLoadingSpinner } from '../../Common/LoadingSpinner'; import useSWR from 'swr'; import { defineMessages, useIntl } from 'react-intl'; import { SonarrSeries } from '../../../../server/api/sonarr'; const messages = defineMessages({ next: 'Next', notvdbid: 'Manual match required', notvdbiddescription: "We couldn't automatically match your request. Please select the correct match from the list below.", nosummary: 'No summary for this title was found.', }); interface SearchByNameModalProps { setTvdbId: (id: number) => void; tvdbId: number | undefined; loading: boolean; onCancel?: () => void; closeModal: () => void; modalTitle: string; tmdbId: number; } const SearchByNameModal: React.FC = ({ setTvdbId, tvdbId, loading, onCancel, closeModal, modalTitle, tmdbId, }) => { const intl = useIntl(); const { data, error } = useSWR( `/api/v1/service/sonarr/lookup/${tmdbId}` ); const handleClick = (tvdbId: number) => { setTvdbId(tvdbId); }; return ( } > {intl.formatMessage(messages.notvdbiddescription)} {!data && !error && }
{data?.slice(0, 6).map((item) => ( ))}
); }; export default SearchByNameModal;