From a277372f43a3a433f5ee0b6a56a99333778e9f24 Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Sun, 5 Apr 2026 22:48:47 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=94=20feat:=20add=20base=20structure?= =?UTF-8?q?=20for=20anime=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(session)/(main)/anime/[slug]/page.tsx | 9 ++++ features/anime/actions/getAnimeBySlug.ts | 44 +++++++++++++++++++ features/anime/index.tsx | 11 +++++ features/anime/sections/Information/main.tsx | 9 ++++ .../anime/sections/Information/skeleton.tsx | 3 ++ .../anime/sections/Information/wrapper.tsx | 15 +++++++ 6 files changed, 91 insertions(+) create mode 100644 app/(session)/(main)/anime/[slug]/page.tsx create mode 100644 features/anime/actions/getAnimeBySlug.ts create mode 100644 features/anime/index.tsx create mode 100644 features/anime/sections/Information/main.tsx create mode 100644 features/anime/sections/Information/skeleton.tsx create mode 100644 features/anime/sections/Information/wrapper.tsx diff --git a/app/(session)/(main)/anime/[slug]/page.tsx b/app/(session)/(main)/anime/[slug]/page.tsx new file mode 100644 index 0000000..c95af2a --- /dev/null +++ b/app/(session)/(main)/anime/[slug]/page.tsx @@ -0,0 +1,9 @@ +import AnimeIndex from "@/features/anime"; + +export default function page() { + return ( +
+ +
+ ); +} diff --git a/features/anime/actions/getAnimeBySlug.ts b/features/anime/actions/getAnimeBySlug.ts new file mode 100644 index 0000000..b7c8302 --- /dev/null +++ b/features/anime/actions/getAnimeBySlug.ts @@ -0,0 +1,44 @@ +export const getAnimeBySlug = async (slug: string) => { + return { + success: true, + status: 200, + message: "Media fetched successfully", + data: { + id: "019cc6ea-5f59-70ec-8c64-2c716a32e0a9", + title: "Sakamoto Days", + titleAlternative: [ + { + type: "Default", + title: "Sakamoto Days", + }, + { + type: "Japanese", + title: "SAKAMOTO DAYS", + }, + { + type: "English", + title: "Sakamoto Days", + }, + ], + slug: "sakamoto-days", + malId: 58939, + pictureMedium: "https://myanimelist.net/images/anime/1026/146459.webp", + pictureLarge: "https://myanimelist.net/images/anime/1026/146459l.webp", + country: "JP", + score: "7.59", + status: "Finished Airing", + startAiring: "2025-01-11T00:00:00.000Z", + endAiring: "2025-03-22T00:00:00.000Z", + synopsis: + "The name Tarou Sakamoto once instilled fear in every villain. No other professional hitman matched his prowess, and fellow assassins revered him. However, Sakamoto fell in love. In five short years, he married, became a father, put on some weight, and traded his weapons for an apron as he became the owner of a humble convenience store.\n\nAlthough Sakamoto is decidedly retired, he finds his old life of crime hard to shake off. His former partner, Shin Asakura, reappears and resolves to stay with Sakamoto's family under their strict no-kill rule. To make matters worse, a large bounty is placed on Sakamoto's head. Numerous assassins now pursue him—but they are in for a surprise. Sakamoto has not lost his edge, and no matter what tricks his enemies pull, he will fight off every last one to protect his dear family.\n\n[Written by MAL Rewrite]", + ageRating: "R - 17+ (violence & profanity)", + mediaType: "TV", + source: "Manga", + onDraft: false, + uploadedBy: "019c0645-a3b5-747a-83bb-0fca3040f951", + deletedAt: null, + createdAt: "2026-02-19T14:35:00.053Z", + updatedAt: "2026-03-07T06:09:34.575Z", + }, + }; +}; diff --git a/features/anime/index.tsx b/features/anime/index.tsx new file mode 100644 index 0000000..90f6e32 --- /dev/null +++ b/features/anime/index.tsx @@ -0,0 +1,11 @@ +import AnimeInformation from "./sections/Information/wrapper"; + +const AnimeIndex = () => { + return ( +
+ +
+ ); +}; + +export default AnimeIndex; diff --git a/features/anime/sections/Information/main.tsx b/features/anime/sections/Information/main.tsx new file mode 100644 index 0000000..0f54362 --- /dev/null +++ b/features/anime/sections/Information/main.tsx @@ -0,0 +1,9 @@ +import { getAnimeBySlug } from "../../actions/getAnimeBySlug"; + +const AnimeInformationMain = async () => { + const data = async () => await getAnimeBySlug("sakamoto-days"); + const result = await data(); + return
Data: {JSON.stringify(result)}
; +}; + +export default AnimeInformationMain; diff --git a/features/anime/sections/Information/skeleton.tsx b/features/anime/sections/Information/skeleton.tsx new file mode 100644 index 0000000..ec37555 --- /dev/null +++ b/features/anime/sections/Information/skeleton.tsx @@ -0,0 +1,3 @@ +export const AnimeInformationSkeleton = () => { + return
Loading...
; +}; diff --git a/features/anime/sections/Information/wrapper.tsx b/features/anime/sections/Information/wrapper.tsx new file mode 100644 index 0000000..0ace8a0 --- /dev/null +++ b/features/anime/sections/Information/wrapper.tsx @@ -0,0 +1,15 @@ +import React, { Suspense } from "react"; +import AnimeInformationMain from "./main"; +import { AnimeInformationSkeleton } from "./skeleton"; + +const AnimeInformation = () => { + return ( +
+ }> + + +
+ ); +}; + +export default AnimeInformation;