aboutsummaryrefslogtreecommitdiff
path: root/src/app/anime/search/components/fetchedInfo.js
blob: 9a1d187edb8f5d9c409ff40391770776ab55fa68 (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
import styles from "../search.module.css";
import Link from "next/link";
import Image from "next/image";

export default async function fetchedInfo(data) {
	return (
		<div className={styles.animeEntry}>
			{data ? (
				data.results && data.results.length > 0 ? (
					data.results.map((item, index) => (
						<Link
							key={index}
							href={`/anime/${item.id}`}
							style={{ textDecoration: "none" }}
						>
							<div className={styles.anime}>
								<p>{item.title}</p>
								<Image
									src={item.image}
									className={styles.animeImage}
									width={120}
									height={160}
									alt="Drama Poster"
								/>
							</div>
						</Link>
					))
				) : (
					<div style={{ margin: "0px auto" }}>
						<p
							style={{
								color: "white",
								fontFamily: "Kanit",
								fontSize: 18,
							}}
						>
							No results found
						</p>
					</div>
				)
			) : null}
		</div>
	);
}