import { CheckIcon, TrashIcon } from '@heroicons/react/solid'; import axios from 'axios'; import { defineMessages, useIntl } from 'react-intl'; import { mutate } from 'swr'; import globalMessages from '../../i18n/globalMessages'; import Button from '../Common/Button'; interface ErrorCardProps { id: number; tmdbId: number; tvdbId?: number; type: 'movie' | 'tv'; canExpand?: boolean; } const messages = defineMessages({ mediaerror: '{mediaType} Not Found', tmdbid: 'TMDB ID', tvdbid: 'TheTVDB ID', cleardata: 'Clear Data', }); const Error = ({ id, tmdbId, tvdbId, type, canExpand }: ErrorCardProps) => { const intl = useIntl(); const deleteMedia = async () => { await axios.delete(`/api/v1/media/${id}`); mutate('/api/v1/media?filter=allavailable&take=20&sort=mediaAdded'); mutate('/api/v1/request?filter=all&take=10&sort=modified&skip=0'); }; return (