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 ? (
) : (
)}
Studios
{info ? (
info.studios?.edges[0].node.name
) : (
)}
Status
{info ? info.status : }
Titles
{info ? (
<>
{info.title?.romaji || ""}
{info.title?.english || ""}
{info.title?.native || ""}
>
) : (
)}
{/*
*/}
{info &&
info.genres?.map((item, index) => (
{item}
))}
{/*
*/}
{/* {
} */}
{!showComments && (
)}
{showComments && (
)}
);
}