blob: 5bf890406bdf194dccdd045db974c88d93ecb5dd (
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
45
46
47
48
49
50
51
|
import Link from "next/link";
import Image from "next/image";
import { Atkinson_Hyperlegible } from "next/font/google";
import styles from "../styles/pop_recent_top.module.css";
import { popular, anime_info } from "../data-fetch/request";
import { preFetchAnimeInfo } from "./cacher";
const atkinson = Atkinson_Hyperlegible({ subsets: ["latin"], weight: "400" });
const PopularAnimes = async () => {
const data = await popular();
preFetchAnimeInfo(data);
return (
<main className={styles.Main}>
<section>
<h2 className={styles.AnimeHeaderText}>Popular Animes</h2>
<div className={styles.AnimeContainer}>
{data &&
data.results.map((item, index) => (
<Link
key={index}
href={`/anime/${item.id}`}
shallow
style={{
color: "white",
textDecoration: "none",
}}
className={atkinson.className}
title={item.title}
>
<section className={styles.AnimeEntry}>
<Image
src={item.image}
width={167}
height={267}
alt="Anime Poster Image"
/>
<p>{item.title}</p>
</section>
</Link>
))}
</div>
</section>
</main>
);
};
export default PopularAnimes;
|