import React from "react"; import "./index.scss"; import downwardArrow from "./arrow-down.svg"; import profilePic from "./profile-pic.svg"; import home from "./home-2.svg"; import square from "./square.svg"; import wallet from "./wallet-3.svg"; import discount from "./discount-shape.svg"; import receipt from "./receipt-text.svg"; import profileIcon from "./profilee.svg"; import setting from "./setting.svg"; import logout from "./logout.svg"; import search from "./search-normal.svg"; import notification from "./notification.svg"; import Switch from "../../Switch"; const SidebarMenu = ({ items, buttons, username, userJob }) => { return (
{/* profile */}

{username}

{userJob}

{/* search box */}
{/* items */} {items.map((item, i) => (

{item.title}

{/* menu items */} {item.menuItems.map((menuItem, index) => (

{menuItem.title}

{menuItem.notification && (
{menuItem.notification}
)}
))}
))}
); }; export default SidebarMenu; SidebarMenu.defaultProps = { items: [ { title: "منوی کاربری برای شما", menuItems: [ { icon: home, title: "صفحه اصلی", borderRadius: "rounded", backgroundColor: "bg-gray-200", borderColor: "border-gray-200", notification: "8+", menuSubItems: [], }, { icon: square, title: "داشبود من", borderRadius: null, backgroundColor: null, borderColor: null, notification: null, menuSubItems: [], }, { icon: notification, title: "مرکز اعلانات", borderRadius: "rounded-full", backgroundColor: "bg-transparent", borderColor: "border-gray-200", notification: "+8", menuSubItems: [], }, ], }, { title: "حسابداری و مالی", menuItems: [ { icon: wallet, title: "کیف پول", borderRadius: null, backgroundColor: null, borderColor: null, notification: null, menuSubItems: [], }, { icon: discount, title: "کوپن ها", borderRadius: "rounded-full", backgroundColor: "bg-transparent", borderColor: "border-gray-200", notification: "+", menuSubItems: [], }, { icon: receipt, title: "رسید ها", borderRadius: null, backgroundColor: null, borderColor: null, notification: null, menuSubItems: [], }, ], }, { title: "حسابداری و مالی", menuItems: [ { icon: profileIcon, title: "حساب کاربری", borderRadius: null, backgroundColor: null, borderColor: null, notification: null, menuSubItems: [], }, { icon: setting, title: "تنظیمات", borderRadius: null, backgroundColor: null, borderColor: null, notification: null, menuSubItems: [], }, { icon: logout, title: "خروج از حساب کاربری", borderRadius: null, backgroundColor: null, borderColor: null, notification: null, menuSubItems: [], }, ], }, ], // buttons: [ // { icon: moon, title: "حالت شب", leftIcon: moon }, // { icon: logout, title: "خروج از حساب کاربری", leftIcon: null }, // ], username: "رستم پهلوان زاده", userJob: "مدیریت سامانه هوشمند", }; // { // buttons.map((button, i) => ( //
// {/* divider */} //
//
// //

{button.title}

// {button.leftIcon && } //
//
// )); // } { /* sub items */ } { /* {item.subItems.map((subItem, i) => (
{subItem.name && (

{subItem.name}

)} {subItem.num && (
{subItem.num}
)}
))} */ }