From cd95a87b75cf63306809dd3d8a4b279a219a64dc Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Tue, 17 Feb 2026 18:02:35 +0800 Subject: [PATCH] qudoco project --- app/(admin)/admin/content-website/page.tsx | 35 ++ app/(admin)/admin/media-library/page.tsx | 36 ++ app/(admin)/admin/my-content/page.tsx | 36 ++ app/(admin)/admin/news-article/image/page.tsx | 36 ++ .../landing-page/retracting-sidedar.tsx | 425 +++++++++--------- components/main/content-website.tsx | 130 ++++++ .../main/dashboard/dashboard-container.tsx | 203 +++++---- components/main/media-library.tsx | 156 +++++++ components/main/my-content.tsx | 186 ++++++++ components/main/news-image.tsx | 224 +++++++++ 10 files changed, 1173 insertions(+), 294 deletions(-) create mode 100644 app/(admin)/admin/content-website/page.tsx create mode 100644 app/(admin)/admin/media-library/page.tsx create mode 100644 app/(admin)/admin/my-content/page.tsx create mode 100644 app/(admin)/admin/news-article/image/page.tsx create mode 100644 components/main/content-website.tsx create mode 100644 components/main/media-library.tsx create mode 100644 components/main/my-content.tsx create mode 100644 components/main/news-image.tsx diff --git a/app/(admin)/admin/content-website/page.tsx b/app/(admin)/admin/content-website/page.tsx new file mode 100644 index 0000000..eb5f4ce --- /dev/null +++ b/app/(admin)/admin/content-website/page.tsx @@ -0,0 +1,35 @@ +"use client"; + +import ContentWebsite from "@/components/main/content-website"; +import DashboardContainer from "@/components/main/dashboard/dashboard-container"; +import { motion } from "framer-motion"; +import { useEffect, useState } from "react"; + +export default function ContentWebsitePage() { + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) { + return ( +
+
+
+ ); + } + + return ( + +
+ +
+
+ ); +} diff --git a/app/(admin)/admin/media-library/page.tsx b/app/(admin)/admin/media-library/page.tsx new file mode 100644 index 0000000..0987b6d --- /dev/null +++ b/app/(admin)/admin/media-library/page.tsx @@ -0,0 +1,36 @@ +"use client"; + +import ContentWebsite from "@/components/main/content-website"; +import DashboardContainer from "@/components/main/dashboard/dashboard-container"; +import MediaLibrary from "@/components/main/media-library"; +import { motion } from "framer-motion"; +import { useEffect, useState } from "react"; + +export default function MediaLibraryPage() { + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) { + return ( +
+
+
+ ); + } + + return ( + +
+ +
+
+ ); +} diff --git a/app/(admin)/admin/my-content/page.tsx b/app/(admin)/admin/my-content/page.tsx new file mode 100644 index 0000000..a1bc76c --- /dev/null +++ b/app/(admin)/admin/my-content/page.tsx @@ -0,0 +1,36 @@ +"use client"; + +import ContentWebsite from "@/components/main/content-website"; +import DashboardContainer from "@/components/main/dashboard/dashboard-container"; +import MyContent from "@/components/main/my-content"; +import { motion } from "framer-motion"; +import { useEffect, useState } from "react"; + +export default function MyContentPage() { + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) { + return ( +
+
+
+ ); + } + + return ( + +
+ +
+
+ ); +} diff --git a/app/(admin)/admin/news-article/image/page.tsx b/app/(admin)/admin/news-article/image/page.tsx new file mode 100644 index 0000000..161759c --- /dev/null +++ b/app/(admin)/admin/news-article/image/page.tsx @@ -0,0 +1,36 @@ +"use client"; + +import ContentWebsite from "@/components/main/content-website"; +import DashboardContainer from "@/components/main/dashboard/dashboard-container"; +import NewsImage from "@/components/main/news-image"; +import { motion } from "framer-motion"; +import { useEffect, useState } from "react"; + +export default function ImagePage() { + const [mounted, setMounted] = useState(false); + + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) { + return ( +
+
+
+ ); + } + + return ( + +
+ +
+
+ ); +} diff --git a/components/landing-page/retracting-sidedar.tsx b/components/landing-page/retracting-sidedar.tsx index 33fdf2b..430f682 100644 --- a/components/landing-page/retracting-sidedar.tsx +++ b/components/landing-page/retracting-sidedar.tsx @@ -15,6 +15,20 @@ interface RetractingSidebarProps { updateSidebarData: (newData: boolean) => void; } +interface SidebarItem { + title: string; + + link?: string; + children?: SidebarItem[]; +} + +interface SidebarSection { + title?: string; + items?: SidebarItem[]; + + children?: SidebarItem[]; +} + const getSidebarByRole = (role: string) => { if (role === "Admin") { return [ @@ -48,12 +62,62 @@ const getSidebarByRole = (role: string) => { ], }, { - title: "Content Management", items: [ { - title: "Articles", + title: "Content Website", icon: () => , - link: "/admin/article", + link: "/admin/content-website", + }, + ], + }, + { + title: "News & Article", + items: [ + { + title: "News & Article", + icon: () => ( + + ), + children: [ + { + title: "Text", + icon: () => , + link: "/admin/news-article/text", + }, + { + title: "Image", + icon: () => , + link: "/admin/news-article/image", + }, + { + title: "Video", + icon: () => , + link: "/admin/news-article/video", + }, + { + title: "Audio", + icon: () => , + link: "/admin/news-article/audio", + }, + ], + }, + ], + }, + { + items: [ + { + title: "My Content", + icon: () => , + link: "/admin/my-content", + }, + ], + }, + { + items: [ + { + title: "Media Library", + icon: () => , + link: "/admin/media-library", }, ], }, @@ -180,7 +244,11 @@ const SidebarContent = ({ const [username, setUsername] = useState("Guest"); const [roleName, setRoleName] = useState(""); + const [openMenus, setOpenMenus] = useState([]); + // =============================== + // GET COOKIE + // =============================== useEffect(() => { const getCookie = (name: string) => { const match = document.cookie.match( @@ -190,237 +258,190 @@ const SidebarContent = ({ }; const cookieUsername = getCookie("username"); - const cookieRole = getCookie("roleName"); // pastikan nama cookie sesuai + const cookieRole = getCookie("roleName"); - if (cookieUsername) { - setUsername(cookieUsername); - } - - if (cookieRole) { - setRoleName(cookieRole); - } + if (cookieUsername) setUsername(cookieUsername); + if (cookieRole) setRoleName(cookieRole); }, []); + // =============================== + // AUTO EXPAND JIKA DI NEWS ARTICLE + // =============================== + useEffect(() => { + if (pathname.startsWith("/admin/news-article")) { + setOpenMenus(["News & Article"]); + } + }, [pathname]); + + const toggleMenu = (title: string) => { + setOpenMenus((prev) => + prev.includes(title) + ? prev.filter((item) => item !== title) + : [...prev, title], + ); + }; + const sidebarSections = getSidebarByRole(roleName); return (
- {/* SCROLLABLE TOP SECTION */} + {/* ========================= */} + {/* SCROLLABLE AREA */} + {/* ========================= */}
- {/* HEADER SECTION */}
- {/* Logo and Toggle */} + {/* HEADER */}
-
- -
-
- {open && ( - - - Arah Negeri - - Admin Panel - - )} + {open && ( - updateSidebarData(false)} > - - + + )}
- {/* Navigation Sections */} + {/* ========================= */} + {/* MENU SECTION */} + {/* ========================= */}
{sidebarSections.map((section, sectionIndex) => ( - - {open && ( - +
+ {open && section.title && ( +

{section.title} - +

)} +
- {section.items.map((item, itemIndex) => ( - -
- +
))}
- {/* FIXED BOTTOM SECTION */} -
- {/* Divider */} - {/*
-
-
*/} - - {/* Theme Toggle */} -
- - -
- {theme === "dark" ? ( - - ) : ( - - )} -
-
- - {open && ( - - {theme === "dark" ? "Light Mode" : "Dark Mode"} - - )} -
-
- - {/* Settings */} -
- -
- - {/* User Profile */} - + {/* THEME TOGGLE */} + - {/* Expand Button for Collapsed State */} - {/* {!open && ( - - - - )} */} + {/* SETTINGS */} + +
); diff --git a/components/main/content-website.tsx b/components/main/content-website.tsx new file mode 100644 index 0000000..836a3a1 --- /dev/null +++ b/components/main/content-website.tsx @@ -0,0 +1,130 @@ +"use client"; + +import { useState } from "react"; +import { Card, CardContent } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; +import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Eye, Pencil, ImageIcon } from "lucide-react"; + +export default function ContentWebsite() { + const [activeTab, setActiveTab] = useState("hero"); + + return ( +
+ {/* ================= HEADER ================= */} +
+
+

+ Content Website +

+

+ Update homepage content, products, services, and partners +

+
+ +
+ + + +
+
+ + {/* ================= TABS ================= */} + + + + Hero Section + + + About Us + + + Our Products + + + Our Services + + + Technology Partners + + + Pop Up + + + + + {/* ================= FORM CARD ================= */} + + + {/* Row 1 */} +
+
+ + +
+ +
+ + +
+
+ + {/* Description */} +
+ +