From 4c4f8214637ac8d19e16f71d20542982a5eedad7 Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Sat, 11 May 2024 01:33:00 +0530
Subject: UI changes, Logic change and complete re-write for anime page

---
 src/app/anime/components/topAiring.jsx | 54 ++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 src/app/anime/components/topAiring.jsx

(limited to 'src/app/anime/components/topAiring.jsx')

diff --git a/src/app/anime/components/topAiring.jsx b/src/app/anime/components/topAiring.jsx
new file mode 100644
index 0000000..28d3f6d
--- /dev/null
+++ b/src/app/anime/components/topAiring.jsx
@@ -0,0 +1,54 @@
+import Link from "next/link";
+import Image from "next/image";
+import { Atkinson_Hyperlegible } from "next/font/google";
+
+import styles from "../styles/pop_recent_top.module.css";
+import { top_airing } from "../data-fetch/request";
+import { preFetchAnimeInfo } from "./cacher";
+
+const atkinson = Atkinson_Hyperlegible({ subsets: ["latin"], weight: "400" });
+
+const TopAiringAnimes = async () => {
+	const data = await top_airing();
+
+	preFetchAnimeInfo(data);
+
+	return (
+		<main className={styles.Main}>
+			<section>
+				<h2 className={styles.AnimeHeaderText}>Top Airing Animes</h2>
+				<div className={styles.AnimeContainer}>
+					{data &&
+						data.results.map((item, index) => (
+							<Link
+								key={index}
+								href={`/anime/${item.id}`}
+								shallow
+								style={{
+									color: "white",
+									textDecoration: "none",
+								}}
+								className={atkinson.className}
+								title={item.title}
+							>
+								<section className={styles.AnimeEntry}>
+									<Image
+										src={item.image}
+										width={167}
+										height={267}
+										alt="Anime Poster Image"
+									/>
+									<p>{item.title}</p>
+									<p className={styles.EpisodeText}>
+										Episode: {item.episodeNumber}
+									</p>
+								</section>
+							</Link>
+						))}
+				</div>
+			</section>
+		</main>
+	);
+};
+
+export default TopAiringAnimes;
-- 
cgit v1.2.3

