import * as React from "react"; import { cx } from "@emotion/css"; import { Expandable } from "../../expandable"; import { SidebarItemLabelProps } from "./SidebarItemLabel"; import { sidebarNavItem, appChromeInsetContent } from "../style"; import { listReset } from "../../shared/styles/styleUtils"; import { useTheme, ThemeProvider } from "@emotion/react"; import { AppChromeTheme } from "../types"; import { IconSize } from "../../shared/types/iconSize"; export interface SidebarSubMenuProps { isOpen?: boolean; onOpen?: () => void; onClose?: () => void; label: React.ReactElement; menuHasIcon?: boolean; iconWidth?: IconSize; theme?: AppChromeTheme; disabled?: boolean; children?: React.ReactNode | React.ReactNode[]; } export const getSubItemList = (items: React.ReactNode[] | React.ReactNode) => ( ); export const SidebarSubMenuComponent = ({ children, label, isOpen, disabled, menuHasIcon }: SidebarSubMenuProps) => { const theme: AppChromeTheme = useTheme(); const dataCy = [ "sidebarSubMenu", ...(isOpen ? ["sidebarSubMenu.open"] : []) ].join(" "); const adjustedTheme = ancestorTheme => { return { menuHasIcon, ...ancestorTheme }; }; return (
  • {label}} indicatorPosition="right" >
      {React.Children.toArray(children).map((item, i) => (
    • {item}
    • ))}
  • ); }; export default SidebarSubMenuComponent;