aboutsummaryrefslogtreecommitdiff
path: root/src/app/top-airing/page.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/top-airing/page.js')
-rw-r--r--src/app/top-airing/page.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/app/top-airing/page.js b/src/app/top-airing/page.js
new file mode 100644
index 0000000..4b660fc
--- /dev/null
+++ b/src/app/top-airing/page.js
@@ -0,0 +1,40 @@
+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 href={`/info/${item.id}`} style={{textDecoration: "none"}}>
+ <div key={index} className="trendingEntries">
+ <Image
+ src={item.image}
+ className="{trendingImage}"
+ width={160}
+ height={220}
+ alt="Drama"
+ />
+ <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 data = res.json();
+ return data;
+} \ No newline at end of file