import { useParams } from 'react-router-dom'; import { useQuery } from '@tanstack/react-query'; import { Loader2, AlertTriangle } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { api } from '../api/client'; import { useTheme } from '../contexts/ThemeContext'; export function ExternalLinkPage() { const { t } = useTranslation(); const { id } = useParams<{ id: string }>(); const { mode } = useTheme(); const { data: link, isLoading, error } = useQuery({ queryKey: ['external-link', id], queryFn: () => api.getExternalLink(Number(id)), enabled: !!id, }); if (isLoading) { return (
); } if (error || !link) { return (

{t('common.linkNotFound')}

); } return (