diff --git a/src/pages/TopFlix.tsx b/src/pages/TopFlix.tsx index c7e6ccb7..c19b4451 100644 --- a/src/pages/TopFlix.tsx +++ b/src/pages/TopFlix.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import { ReactNode, useEffect, useState } from "react"; -import { Link } from "react-router-dom"; // Import Link from react-router-dom +import { useNavigate } from "react-router-dom"; // Import Link from react-router-dom import { ThiccContainer } from "@/components/layout/ThinContainer"; import { Divider } from "@/components/utils/Divider"; @@ -43,14 +43,10 @@ function isShowOrMovie(tmdbFullId: string): "series" | "movie" | "unknown" { function directLinkToContent(tmdbFullId: string) { if (isShowOrMovie(tmdbFullId) === "series") { - return `/media/tmdb-tv-${tmdbFullId.split("-")[1]}#/media/tmdb-tv-${ - tmdbFullId.split("-")[1] - }`; + return `/media/tmdb-tv-${tmdbFullId.split("-")[1]}`; } if (isShowOrMovie(tmdbFullId) === "movie") { - return `/media/tmdb-movie-${tmdbFullId.split("-")[1]}#/media/tmdb-movie-${ - tmdbFullId.split("-")[1] - }`; + return `/media/tmdb-movie-${tmdbFullId.split("-")[1]}`; } return null; } @@ -61,15 +57,16 @@ function ConfigValue(props: { id: string; children?: ReactNode; }) { + const navigate = useNavigate(); const link = directLinkToContent(props.id); return ( <>
{link ? ( - +
navigate(link)} className="hover:underline"> {props.name} - +
) : ({props.name}
)} @@ -160,14 +157,12 @@ async function getTimeSinceProcessStart(): PromiseLoading...
- ); - } - return (Loading...
- ); - } - return (