/** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; import { RcMenuOptions, RcMenuSubSubEntry } from '../RcMenuTypes'; export interface RcMenuSubSubCompProps { subsub: RcMenuSubSubEntry; options: RcMenuOptions; } export const RcMenuSubSubComp: React.FC = ({ subsub, options }) => { const styleRoot = css` padding-top: ${options.gapVertSubSubEntries}; margin-left: ${options.subIconSize ? `calc(${options.subIconSize} + ${options.gapHorizLabel})` : options.gapHorizLabel}; `; const styleIconLabel = css` display: flex; flex-direction: row; align-items: center; `; const styleLabel = (underline = false) => css` color: ${options.colorLabel}; ${options.labelSubWordBreak ? `word-break: break-all;` : ''} ${underline ? 'text-decoration: underline;' : 'text-decoration: none;'} font-size: ${options.fontSizeSubSubEntries}; cursor: pointer; :hover { color: ${options.colorLabelHover}; } `; const styleIcon = css` color: ${options.colorIcon}; margin-right: ${options.gapHorizSubSubLabel}; `; if (subsub.comp) { return
{subsub.comp}
; } const ele = subsub.link ? ( subsub.link ) : subsub.onClick ? (
{subsub.label}
) : ( {subsub.label} ); return (
{subsub.icon}
{ele}
); };