import Button from '@app/components/Common/Button'; import globalMessages from '@app/i18n/globalMessages'; import defineMessages from '@app/utils/defineMessages'; import { CheckIcon, TrashIcon } from '@heroicons/react/24/solid'; import axios from 'axios'; import { useIntl } from 'react-intl'; import { mutate } from 'swr'; interface ErrorCardProps { id: number; tmdbId: number; tvdbId?: number; type: 'movie' | 'tv'; canExpand?: boolean; } const messages = defineMessages('components.TitleCard', { mediaerror: '{mediaType} Not Found', tmdbid: 'TMDB ID', tvdbid: 'TheTVDB ID', cleardata: 'Clear Data', }); const ErrorCard = ({ 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 (