aboutsummaryrefslogtreecommitdiff
path: root/src/app/top-airing/page.js
blob: e564e1688c7014de9b6afc2f6d74454acedee973 (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
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={`/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 data = res.json();
	return data;
}