From 50a0f0240d7fef133eb5acc1bea2b1168b08e9db Mon Sep 17 00:00:00 2001 From: Factiven Date: Sun, 24 Dec 2023 13:03:54 +0700 Subject: migrate to typescript --- components/watch/primary/details.js | 193 ------------------------------------ 1 file changed, 193 deletions(-) delete mode 100644 components/watch/primary/details.js (limited to 'components/watch/primary/details.js') diff --git a/components/watch/primary/details.js b/components/watch/primary/details.js deleted file mode 100644 index 4af12ac..0000000 --- a/components/watch/primary/details.js +++ /dev/null @@ -1,193 +0,0 @@ -import { useEffect, useState } from "react"; -import { useAniList } from "../../../lib/anilist/useAnilist"; -import Skeleton from "react-loading-skeleton"; -import DisqusComments from "../../disqus"; -import Image from "next/image"; - -export default function Details({ - info, - session, - epiNumber, - description, - id, - onList, - setOnList, - handleOpen, - disqus, -}) { - const [showComments, setShowComments] = useState(false); - const { markPlanning } = useAniList(session); - - function handlePlan() { - if (onList === false) { - markPlanning(info.id); - setOnList(true); - } - } - - useEffect(() => { - const isMobile = window.matchMedia("(max-width: 768px)").matches; - if (isMobile) { - setShowComments(false); - } else { - setShowComments(true); - } - }, [id]); - - return ( -
- {/*
*/} -
-
- {info ? ( - Anime Cover - ) : ( - - )} -
-
-
-

- Studios -

-
- {info ? ( - info.studios?.edges[0].node.name - ) : ( - - )} -
-
-
- { - session ? handlePlan() : handleOpen(); - }} - className={`w-8 h-8 hover:fill-white text-white hover:cursor-pointer ${ - onList ? "fill-white" : "" - }`} - > - - -
-
-
-
-

- Status -

-
{info ? info.status : }
-
-
-

- Titles -

-
- {info ? ( - <> -
- {info.title?.romaji || ""} -
-
- {info.title?.english || ""} -
-
- {info.title?.native || ""} -
- - ) : ( - - )} -
-
-
-
- {/*
*/} -
- {info && - info.genres?.map((item, index) => ( -
- {item} -
- ))} -
- {/*
*/} -
- {info && ( -

- )} -

- {/* {
} */} - {!showComments && ( -
- -
- )} - {showComments && ( -
- {info && ( -
- -
- )} -
- )} -
- ); -} -- cgit v1.2.3