From 3fa10598fe171c9cebca88062e7b9ca78d469558 Mon Sep 17 00:00:00 2001 From: real-zephex Date: Thu, 18 Apr 2024 21:43:10 +0530 Subject: feature added: tracker for mangas --- src/app/manga/history/continueWatching/page.jsx | 70 +++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/app/manga/history/continueWatching/page.jsx (limited to 'src/app/manga/history/continueWatching/page.jsx') diff --git a/src/app/manga/history/continueWatching/page.jsx b/src/app/manga/history/continueWatching/page.jsx new file mode 100644 index 0000000..0d0a02e --- /dev/null +++ b/src/app/manga/history/continueWatching/page.jsx @@ -0,0 +1,70 @@ +"use client"; + +import React, { useState, useEffect } from "react"; +import Image from "next/image"; +import styles from "./cw.module.css"; +import Link from "next/link"; + +const ContinueWatching = () => { + const [localItems, setLocalItems] = useState(null); + + useEffect(() => { + const newData = get_local(); + setLocalItems(newData); + }, []); // Empty dependency array means this effect runs only once after the initial render + + function get_local() { + try { + const data = localStorage.getItem("mangaData"); + return JSON.parse(data); + } catch (error) { + console.log("error", error); + return false; + } + } + + return ( +
+

Continue Watching

+ {localItems && ( +
+ {localItems.watchHis && + localItems.watchHis.map((item, index) => ( +
+
+

{item.title}

+

+ Currently reading: Volume {item.volume}{" "} + Chapter {item.chapter} +

+
+ + + + + + +
+
+ Continue anime poster +
+ ))} +
+ )} +
+ ); +}; + +export default ContinueWatching; -- cgit v1.2.3