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/search_results.jsx | 42 +++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 src/app/anime/components/search_results.jsx

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

diff --git a/src/app/anime/components/search_results.jsx b/src/app/anime/components/search_results.jsx
new file mode 100644
index 0000000..d4c8146
--- /dev/null
+++ b/src/app/anime/components/search_results.jsx
@@ -0,0 +1,42 @@
+import { Atkinson_Hyperlegible } from "next/font/google";
+import Link from "next/link";
+import Image from "next/image";
+
+import styles from "../styles/search.module.css";
+import { search_results } from "../data-fetch/request";
+import { preFetchAnimeInfo } from "./cacher";
+
+const atkinson = Atkinson_Hyperlegible({ subsets: ["latin"], weight: "400" });
+
+const SearchResults = async (title) => {
+	const data = await search_results(title);
+
+	preFetchAnimeInfo(data);
+
+	return (
+		<section className={styles.SearchResultsContainer}>
+			{data &&
+				data.results.map((item, index) => (
+					<Link
+						shallow
+						href={`/anime/${item.id}`}
+						key={index}
+						className={atkinson.className}
+						style={{ color: "white", textDecoration: "none" }}
+					>
+						<div className={styles.AnimeEntry}>
+							<p>{item.title}</p>
+							<Image
+								src={item.image}
+								width={140}
+								height={200}
+								alt="Anime Poster"
+							/>
+						</div>
+					</Link>
+				))}
+		</section>
+	);
+};
+
+export default SearchResults;
-- 
cgit v1.2.3

