From 1a85c2571690ba592ac5183d5eadaf9846fe532b Mon Sep 17 00:00:00 2001 From: Factiven Date: Mon, 25 Sep 2023 00:44:40 +0700 Subject: Update v4.1.0 (#79) * Update v4.1.0 * Update pages/_app.js --- components/watch/primary/details.js | 189 ++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 components/watch/primary/details.js (limited to 'components/watch/primary') diff --git a/components/watch/primary/details.js b/components/watch/primary/details.js new file mode 100644 index 0000000..32e1391 --- /dev/null +++ b/components/watch/primary/details.js @@ -0,0 +1,189 @@ +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(() => { + setShowComments(false); + }, [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