import { PlayIcon, PlusIcon, ShareIcon } from "@heroicons/react/24/solid";
import Image from "next/image";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import { convertSecondsToTime } from "@/utils/getTimes";
import Link from "next/link";
import InfoChip from "./reused/infoChip";
import Description from "./reused/description";
import { NewNavbar } from "@/components/shared/NavBar";
export default function DetailTop({
info,
statuses,
handleOpen,
watchUrl,
progress,
color,
}) {
const router = useRouter();
const [readMore, setReadMore] = useState(false);
const [showAll, setShowAll] = useState(false);
useEffect(() => {
setReadMore(false);
}, [info.id]);
const handleShareClick = async () => {
try {
if (navigator.share) {
await navigator.share({
title: `Watch Now - ${info?.title?.english}`,
// text: `Watch [${info?.title?.romaji}] and more on Moopa. Join us for endless anime entertainment"`,
url: window.location.href,
});
} else {
// Web Share API is not supported, provide a fallback or show a message
alert("Web Share API is not supported in this browser.");
}
} catch (error) {
console.error("Error sharing:", error);
}
};
return (