diff options
Diffstat (limited to 'src/app/top-airing/page.js')
| -rw-r--r-- | src/app/top-airing/page.js | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/src/app/top-airing/page.js b/src/app/top-airing/page.js index e564e16..b9d54cd 100644 --- a/src/app/top-airing/page.js +++ b/src/app/top-airing/page.js @@ -3,39 +3,42 @@ 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> + <p className="trendingText">Trending</p> <div className="trending"> - {data && data.results.map((item, index) => ( - <Link key={index} href={`/info/${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> - ))} + {data && + data.results.map((item, index) => ( + <Link + key={index} + href={`/info/${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://dramalama-api.vercel.app/anime/gogoanime/top-airing"); + const res = await fetch( + "https://dramalama-api.vercel.app/anime/gogoanime/top-airing" + ); const data = res.json(); return data; -}
\ No newline at end of file +} |