From d6780cf3dad729c69a102ba2940188cf1e6bcbf4 Mon Sep 17 00:00:00 2001 From: zephex Date: Sat, 20 Apr 2024 13:34:53 +0530 Subject: idk whats happening --- src/app/anime/search/components/fetchInfo.js | 28 ++++---- src/app/anime/search/components/fetchedInfo.js | 92 +++++++++++++------------- 2 files changed, 60 insertions(+), 60 deletions(-) (limited to 'src/app/anime/search/components') 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 ( -
- {data ? ( - data.results && data.results.length > 0 ? ( - data.results.map((item, index) => ( - -
-

{item.title}

- Drama Poster -
- - )) - ) : ( -
-

- No results found -

-
- ) - ) : null} -
- ); -} +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 ( +
+ {data ? ( + data.results && data.results.length > 0 ? ( + data.results.map((item, index) => ( + +
+

{item.title}

+ Drama Poster +
+ + )) + ) : ( +
+

+ No results found +

+
+ ) + ) : null} +
+ ); +} -- cgit v1.2.3