diff options
Diffstat (limited to 'src/app/anime/top-airing/page.jsx')
| -rw-r--r-- | src/app/anime/top-airing/page.jsx | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/app/anime/top-airing/page.jsx b/src/app/anime/top-airing/page.jsx index 1d270f0..40a742c 100644 --- a/src/app/anime/top-airing/page.jsx +++ b/src/app/anime/top-airing/page.jsx @@ -1,48 +1,48 @@ -import styles from "./trending.module.css"; -import Image from "next/image"; -import Link from "next/link"; -import { preFetchAnimeInfo } from "../videoLinkfetcher"; - -export default async function Trending() { - const data = await test(); - preFetchAnimeInfo(data); - return ( - <div className={styles.TrendingContainer}> - <div className={styles.TrendingText}> - <p>Trending</p> - </div> - - <div className={styles.trending}> - {data && - data.results.map((item, index) => ( - <Link - key={index} - href={`/anime/${item.id}`} - style={{ textDecoration: "none", color: "white" }} - > - <div className={styles.trendingEntries}> - <Image - src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`} - className={styles.trendingImage} - width={150} - height={230} - alt="Drama" - priority - /> - <p>{item.title}</p> - </div> - </Link> - ))} - </div> - </div> - ); -} - -async function test() { - const res = await fetch( - "https://consumet-jade.vercel.app/anime/gogoanime/top-airing", - { next: { revalidate: 86400 } } - ); - const data = res.json(); - return data; -} +import styles from "./trending.module.css";
+import Image from "next/image";
+import Link from "next/link";
+import { preFetchAnimeInfo } from "../videoLinkfetcher";
+
+export default async function Trending() {
+ const data = await test();
+ preFetchAnimeInfo(data);
+ return (
+ <div className={styles.TrendingContainer}>
+ <div className={styles.TrendingText}>
+ <p>Trending</p>
+ </div>
+
+ <div className={styles.trending}>
+ {data &&
+ data.results.map((item, index) => (
+ <Link
+ key={index}
+ href={`/anime/${item.id}`}
+ style={{ textDecoration: "none", color: "white" }}
+ >
+ <div className={styles.trendingEntries}>
+ <Image
+ src={`https://sup-proxy.zephex0-f6c.workers.dev/api-content?url=${item.image}`}
+ className={styles.trendingImage}
+ width={150}
+ height={230}
+ alt="Drama"
+ priority
+ />
+ <p>{item.title}</p>
+ </div>
+ </Link>
+ ))}
+ </div>
+ </div>
+ );
+}
+
+async function test() {
+ const res = await fetch(
+ "https://consumet-jade.vercel.app/anime/gogoanime/top-airing",
+ { next: { revalidate: 86400 } }
+ );
+ const data = res.json();
+ return data;
+}
|