-
- {React.cloneElement(item.icon, { color: `var(${getColor()})` })}
+
+ {item.icon && React.cloneElement(item.icon, { color: `var(${getColor()})` })}
{item.text}
+ {item.dropdown &&
+ React.cloneElement(, {
+ color: `var(${getColor()})`,
+ })}
+ {item.dropdown && (
+
+ {item.dropdown.items.map((subItem, index) => (
+
+ ))}
+
+ )}
{item.hasSeparator &&
}
);
diff --git a/src/front/Components/DesignSystem/Menu/index.tsx b/src/front/Components/DesignSystem/Menu/index.tsx
index f0dca424..891b978c 100644
--- a/src/front/Components/DesignSystem/Menu/index.tsx
+++ b/src/front/Components/DesignSystem/Menu/index.tsx
@@ -1,35 +1,10 @@
-import { IAppRule } from "@Front/Api/Entities/rule";
-import { ETypoColor } from "@Front/Components/DesignSystem/Typography";
import Rules, { RulesMode } from "@Front/Components/Elements/Rules";
import useHoverable from "@Front/Hooks/useHoverable";
import useOpenable from "@Front/Hooks/useOpenable";
import React, { useEffect, useRef } from "react";
import classes from "./classes.module.scss";
-import MenuItem from "./MenuItem";
-
-type IItemBase = {
- icon: JSX.Element;
- text: string;
- hasSeparator?: boolean;
- color?: ETypoColor;
-};
-
-type IItemWithLink = IItemBase & {
- link: string;
- rules?: IAppRule[];
- routesActive?: string[];
- onClick?: never;
-};
-
-type IItemWithOnClick = IItemBase & {
- onClick: () => void;
- link?: never;
- rules?: never;
- routesActive?: never;
-};
-
-export type IItem = IItemWithLink | IItemWithOnClick;
+import MenuItem, { IItem } from "./MenuItem";
type IProps = {
children: React.ReactNode;
@@ -79,7 +54,7 @@ export default function Menu(props: IProps) {
{items.map((item, index) => {
return (
-
+
);
})}
diff --git a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx
index ef264e44..c7c6722b 100644
--- a/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx
+++ b/src/front/Components/Layouts/Folder/FolderInformation/InformationSection/index.tsx
@@ -1,6 +1,5 @@
import CircleProgress from "@Front/Components/DesignSystem/CircleProgress";
import IconButton, { EIconButtonVariant } from "@Front/Components/DesignSystem/IconButton";
-import Menu, { IItem } from "@Front/Components/DesignSystem/Menu";
import Tag, { ETagColor } from "@Front/Components/DesignSystem/Tag";
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
import Module from "@Front/Config/Module";
@@ -10,6 +9,8 @@ import { useCallback } from "react";
import { AnchorStatus } from "..";
import classes from "./classes.module.scss";
+import { IItem } from "@Front/Components/DesignSystem/Menu/MenuItem";
+import Menu from "@Front/Components/DesignSystem/Menu";
type IProps = {
folder: OfficeFolder | null;