import { RcIcon, RcIconButton, RcMenuItem, RcMenuList, RcPopover, styled, } from '@ringcentral/juno'; import clsx from 'clsx'; import type { FunctionComponent } from 'react'; import React from 'react'; import { CircleButtonWithTitle } from '../CircleButton'; import type { MoreActionComponentProps } from './MoreActionComponent.interface'; import styles from './styles.scss'; export const StyledMenuItem = styled(RcMenuItem)` max-width: 170px; `; export const MoreActionComponent: FunctionComponent< MoreActionComponentProps > = ({ actionsList, disabled = false, rootButtonProps, withSubText, anchorEl, handleClick, handleClose, popoverClasses, dataSign, useJunoIcon = false, }) => { if (!Array.isArray(actionsList) || actionsList.length === 0) { return <>; } return ( <> {!useJunoIcon ? ( ) : ( )} handleClose()} classes={popoverClasses} >
{actionsList.map( ({ icon, text, subText, onClick, disabled, iconClassName, key, }) => (
{icon && ( )} {text && {text}} {withSubText && subText && ( {subText} )}
), )}
); };