aboutsummaryrefslogtreecommitdiff
path: root/src/app/recent
diff options
context:
space:
mode:
authorreal-zephex <[email protected]>2024-03-17 07:08:55 +0530
committerreal-zephex <[email protected]>2024-03-17 07:08:55 +0530
commitbc2963f9e76a4000e3f1747b6fa4affdebba3956 (patch)
tree39fa19bbe792b3b90b526ef5460545c76bca3dcf /src/app/recent
parentminor fixes and feature improvements: added an indicator which shows when the... (diff)
downloaddramalama-bc2963f9e76a4000e3f1747b6fa4affdebba3956.tar.xz
dramalama-bc2963f9e76a4000e3f1747b6fa4affdebba3956.zip
prettified the code :)
Diffstat (limited to 'src/app/recent')
-rw-r--r--src/app/recent/page.js51
1 files changed, 27 insertions, 24 deletions
diff --git a/src/app/recent/page.js b/src/app/recent/page.js
index 0cefca5..2962e0f 100644
--- a/src/app/recent/page.js
+++ b/src/app/recent/page.js
@@ -3,39 +3,42 @@ import Image from "next/image";
import Link from "next/link";
export default async function Releases() {
-
const data = await test();
return (
<div className="trendingContainer">
- <p className="trendingText">
- Recent Releases
- </p>
+ <p className="trendingText">Recent Releases</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>
- ))}
+ {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/recent-episodes");
+ const res = await fetch(
+ "https://dramalama-api.vercel.app/anime/gogoanime/recent-episodes"
+ );
const data = res.json();
return data;
-} \ No newline at end of file
+}