import cn from "classnames"; import { Modifiers } from "popper.js"; import React, { forwardRef, Ref, useState } from "react"; import { Icon, NavbarItem, NavLink, Popover, PopoverBody } from "../"; import { IPopoverProps } from "../popover/popover"; import appsIcon from "!!svg-sprite-loader!@cloudbees/honeyui-icons/svg/apps.svg"; import ListGroup, { IListGroupProps } from "../list/list-group"; import Button from "../button/button"; import { INavLinkProps } from "../nav/nav-link"; import { AsComponent, AsPropsWithChildren } from "../utils/asComponent"; export interface ICloudBeesNavigationProps extends AsPropsWithChildren, React.HTMLAttributes { modifiers?: Modifiers; avoidPreRender?: boolean; header?: React.ReactNode; innerClassName?: string; popoverProps?: IPopoverProps; popoverBodyClassName?: string; /** * Overrides default id used for accessibility */ popoverBodyId?: string; listGroupProps?: IListGroupProps; buttonProps?: INavLinkProps; } type CloudBeesNavigation = AsComponent; const CloudBeesNavigation: CloudBeesNavigation = forwardRef( ( { popoverBodyId = "cloudbees-navigation-body", children, className, modifiers, avoidPreRender, header, innerClassName, as, popoverProps, popoverBodyClassName, listGroupProps, buttonProps, ...props }, ref: Ref ) => { const [active, setActive] = useState(false); const testId = props["data-testid"] || "honeyui-cloudBees-navigation"; return ( setActive(value), placement: "bottom-start", reference: ( ), "data-testid": `${testId}-popover`, avoidPreRender }} {...popoverProps} > {children} ); } ); CloudBeesNavigation.displayName = "CloudBees navigation"; export default CloudBeesNavigation;