blob: 40a742cee1a9481e900f7bb0628244180dc3f284 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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;
}
|