From b7e29a3d67e3e214ba1c958478092ee4075e8171 Mon Sep 17 00:00:00 2001 From: real-zephex Date: Thu, 4 Apr 2024 23:00:53 +0530 Subject: inmidst of rewriting the kdrama section. will complete it soon --- src/app/kdrama/components/popular.jsx | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/app/kdrama/components/popular.jsx (limited to 'src/app/kdrama/components/popular.jsx') diff --git a/src/app/kdrama/components/popular.jsx b/src/app/kdrama/components/popular.jsx new file mode 100644 index 0000000..d9126ec --- /dev/null +++ b/src/app/kdrama/components/popular.jsx @@ -0,0 +1,42 @@ +import styles from "../styles/popular.module.css"; +import Image from "next/image"; +import Link from "next/link"; + +export default async function PopularDramas() { + const popular = await getPopular(); + + return ( +
+

Popular Dramas

+ +
+ {popular && + popular.results.map((item, index) => ( + +
+ Drama Poster +

{item.title}

+
+ + ))} +
+
+ ); +} + +async function getPopular() { + const res = await fetch("https://dramacool-scraper.vercel.app/popular", { + next: { revalidate: 86400 }, + }); + const data = await res.json(); + return data; +} -- cgit v1.2.3