import Badge from '@app/components/Common/Badge'; import Button from '@app/components/Common/Button'; import LoadingSpinner from '@app/components/Common/LoadingSpinner'; import Modal from '@app/components/Common/Modal'; import Transition from '@app/components/Transition'; import globalMessages from '@app/i18n/globalMessages'; import { DocumentTextIcon } from '@heroicons/react/outline'; import { useState } from 'react'; import { defineMessages, FormattedRelativeTime, useIntl } from 'react-intl'; import ReactMarkdown from 'react-markdown'; import useSWR from 'swr'; const messages = defineMessages({ releases: 'Releases', releasedataMissing: 'Release data is currently unavailable.', versionChangelog: '{version} Changelog', viewongithub: 'View on GitHub', latestversion: 'Latest', currentversion: 'Current', viewchangelog: 'View Changelog', }); const REPO_RELEASE_API = 'https://api.github.com/repos/sct/overseerr/releases?per_page=20'; interface GitHubRelease { url: string; assets_url: string; upload_url: string; html_url: string; id: number; node_id: string; tag_name: string; target_commitish: string; name: string; draft: boolean; prerelease: boolean; created_at: string; published_at: string; tarball_url: string; zipball_url: string; body: string; } interface ReleaseProps { release: GitHubRelease; isLatest: boolean; currentVersion: string; } const Release = ({ currentVersion, release, isLatest }: ReleaseProps) => { const intl = useIntl(); const [isModalOpen, setModalOpen] = useState(false); return (