"use client";
import React, { Dispatch, SetStateAction, useState } from "react";
import Image from "next/image";
import { Icon } from "@iconify/react";
import Link from "next/link";
import DashboardContainer from "../main/dashboard/dashboard-container";
import { usePathname } from "next/navigation";
import Option from "./option";
import { motion } from "framer-motion";
interface RetractingSidebarProps {
sidebarData: boolean;
updateSidebarData: (newData: boolean) => void;
}
const sidebarSections = [
{
title: "DashBoard",
items: [
{
title: "Dashboard",
icon: () => (
),
link: "/admin/dashboard",
},
],
},
{
title: "Apps",
items: [
{
title: "Artikel",
icon: () => ,
link: "/admin/article",
},
{
title: "Kategori",
icon: () => ,
link: "/admin/master-category",
},
// {
// title: "Majalah",
// icon: () => ,
// link: "/admin/magazine",
// },
{
title: "Advertise",
icon: () => ,
link: "/admin/advertise",
},
// {
// title: "Komentar",
// icon: () => ,
// link: "/admin/komentar",
// },
],
},
{
title: "Master",
items: [
{
title: "Master Static Page",
icon: () => ,
link: "/admin/static-page",
},
{
title: "Master User",
icon: () => ,
link: "/admin/master-user",
},
],
},
];
export const RetractingSidebar = ({
sidebarData,
updateSidebarData,
}: RetractingSidebarProps) => {
const pathname = usePathname();
return (
<>
{/* DESKTOP SIDEBAR */}
{/* MOBILE SIDEBAR */}
{sidebarData && (
{/* */}
)}
>
);
};
const SidebarContent = ({
open,
pathname,
updateSidebarData,
}: {
open: boolean;
pathname: string;
updateSidebarData: (newData: boolean) => void;
}) => {
return (
<>
{/* BAGIAN ATAS */}
{!open && (
)}

{/* {open && (
)} */}
{open && (
)}
{sidebarSections.map((section) => (
{section.title}
{section.items.map((item) => (
))}
))}
{/* BAGIAN BAWAH */}
>
);
};
const Sidebar = () => {
const [open, setOpen] = useState(true);
const pathname = usePathname();
return (
{/* BAGIAN ATAS */}
{!open && (
)}

{open && (
)}
{sidebarSections.map((section) => (
{section.title}
{section.items.map((item) => (
))}
))}
{/* BAGIAN BAWAH */}
);
};
export default Sidebar;
const TitleSection = ({ open }: { open: boolean }) => {
return (
);
};
const ToggleClose = ({
open,
setOpen,
}: {
open: boolean;
setOpen: Dispatch>;
}) => {
return (
setOpen((pv) => !pv)}>
{/* */}
{/* {open && (
Hide
)} */}
);
};
const ExampleContent = () => (
);