diff options
Diffstat (limited to 'src/app/anime/top-airing/page.jsx')
| -rw-r--r-- | src/app/anime/top-airing/page.jsx | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/app/anime/top-airing/page.jsx b/src/app/anime/top-airing/page.jsx new file mode 100644 index 0000000..5536870 --- /dev/null +++ b/src/app/anime/top-airing/page.jsx @@ -0,0 +1,45 @@ +import "./trending.css"; +import Image from "next/image"; +import Link from "next/link"; + +export default async function Trending() { + const data = await test(); + + return ( + <div className="trendingContainer"> + <p className="trendingText">Trending</p> + + <div className="trending"> + {data && + data.results.map((item, index) => ( + <Link + key={index} + href={`/anime/${item.id}`} + style={{ textDecoration: "none" }} + > + <div className="trendingEntries"> + <Image + src={item.image} + className="{trendingImage}" + width={160} + height={220} + alt="Drama" + priority + /> + <p>{item.title}</p> + </div> + </Link> + ))} + </div> + </div> + ); +} + +async function test() { + const res = await fetch( + "https://consumet-api-di2e.onrender.com/anime/gogoanime/top-airing", + { cache: "force-cache" } + ); + const data = res.json(); + return data; +} |