aboutsummaryrefslogtreecommitdiff
path: root/src/app/anime/search/components
diff options
context:
space:
mode:
authorzephex <[email protected]>2024-04-20 13:34:53 +0530
committerzephex <[email protected]>2024-04-20 13:34:53 +0530
commitd6780cf3dad729c69a102ba2940188cf1e6bcbf4 (patch)
treed10a2aefef6664c42439f165c73722c514b032bc /src/app/anime/search/components
parentfeature added: tracker for mangas (diff)
downloaddramalama-d6780cf3dad729c69a102ba2940188cf1e6bcbf4.tar.xz
dramalama-d6780cf3dad729c69a102ba2940188cf1e6bcbf4.zip
idk whats happening
Diffstat (limited to 'src/app/anime/search/components')
-rw-r--r--src/app/anime/search/components/fetchInfo.js28
-rw-r--r--src/app/anime/search/components/fetchedInfo.js92
2 files changed, 60 insertions, 60 deletions
diff --git a/src/app/anime/search/components/fetchInfo.js b/src/app/anime/search/components/fetchInfo.js
index a458607..f14ea5e 100644
--- a/src/app/anime/search/components/fetchInfo.js
+++ b/src/app/anime/search/components/fetchInfo.js
@@ -1,14 +1,14 @@
-"use server";
-
-export default async function Results(id) {
- return await testFunction(id);
-}
-
-async function testFunction(title) {
- const res = await fetch(
- "https://consumet-jade.vercel.app/anime/gogoanime/" + title,
- { cache: "force-cache" }
- );
- const data = await res.json();
- return data;
-}
+"use server";
+
+export default async function Results(id) {
+ return await testFunction(id);
+}
+
+async function testFunction(title) {
+ const res = await fetch(
+ "https://consumet-jade.vercel.app/anime/gogoanime/" + title,
+ { cache: "force-cache" }
+ );
+ const data = await res.json();
+ return data;
+}
diff --git a/src/app/anime/search/components/fetchedInfo.js b/src/app/anime/search/components/fetchedInfo.js
index aa3ffb1..d88797b 100644
--- a/src/app/anime/search/components/fetchedInfo.js
+++ b/src/app/anime/search/components/fetchedInfo.js
@@ -1,46 +1,46 @@
-import styles from "../search.module.css";
-import Link from "next/link";
-import Image from "next/image";
-import { preFetchAnimeInfo } from "../../videoLinkfetcher";
-
-export default async function fetchedInfo(data) {
- preFetchAnimeInfo(data);
- return (
- <div className={styles.animeEntry}>
- {data ? (
- data.results && data.results.length > 0 ? (
- data.results.map((item, index) => (
- <Link
- key={index}
- href={`/anime/${item.id}`}
- style={{ textDecoration: "none" }}
- >
- <div className={styles.anime}>
- <p>{item.title}</p>
- <Image
- src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`}
- className={styles.animeImage}
- width={120}
- height={180}
- alt="Drama Poster"
- />
- </div>
- </Link>
- ))
- ) : (
- <div style={{ margin: "0px auto" }}>
- <p
- style={{
- color: "white",
- fontFamily: "Kanit",
- fontSize: 18,
- }}
- >
- No results found
- </p>
- </div>
- )
- ) : null}
- </div>
- );
-}
+import styles from "../search.module.css";
+import Link from "next/link";
+import Image from "next/image";
+import { preFetchAnimeInfo } from "../../videoLinkfetcher";
+
+export default async function fetchedInfo(data) {
+ preFetchAnimeInfo(data);
+ return (
+ <div className={styles.animeEntry}>
+ {data ? (
+ data.results && data.results.length > 0 ? (
+ data.results.map((item, index) => (
+ <Link
+ key={index}
+ href={`/anime/${item.id}`}
+ style={{ textDecoration: "none" }}
+ >
+ <div className={styles.anime}>
+ <p>{item.title}</p>
+ <Image
+ src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`}
+ className={styles.animeImage}
+ width={120}
+ height={180}
+ alt="Drama Poster"
+ />
+ </div>
+ </Link>
+ ))
+ ) : (
+ <div style={{ margin: "0px auto" }}>
+ <p
+ style={{
+ color: "white",
+ fontFamily: "Kanit",
+ fontSize: 18,
+ }}
+ >
+ No results found
+ </p>
+ </div>
+ )
+ ) : null}
+ </div>
+ );
+}