Import useLocation in EntryPage for location-based logic

This commit is contained in:
2026-01-08 03:06:23 +01:00
parent 572797b257
commit 4286e38fb5

View File

@@ -1,5 +1,5 @@
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useMemo, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom'; import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { fetchEntry } from '../api'; import { fetchEntry } from '../api';
import VideoPlayer from '../components/VideoPlayer'; import VideoPlayer from '../components/VideoPlayer';
import { ConversationPanel, GrammarPanel, KeyPhrasePanel, VocabPanel } from '../components/ItemPanels'; import { ConversationPanel, GrammarPanel, KeyPhrasePanel, VocabPanel } from '../components/ItemPanels';
@@ -8,6 +8,7 @@ import type { EntryDetail } from '../types';
export default function EntryPage() { export default function EntryPage() {
const { idEncoded } = useParams(); const { idEncoded } = useParams();
const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
const [entry, setEntry] = useState<EntryDetail | null>(null); const [entry, setEntry] = useState<EntryDetail | null>(null);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);