/** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; import { Fragment } from 'react'; import { RcIconClose } from '../icons'; import { OutsideClick } from '../helpers'; import { rcConfig } from './rcConfig'; export interface RcSideNavEntry { item: any; onClick?: () => void; } export interface RcSideNavProps { onClose: () => void; entries?: RcSideNavEntry[]; width?: string; iconSize?: string; iconPadding?: string; color?: string; bgColor?: string; zIndex?: number; menuEntryFontsize?: string; bottomVSpace?: string; } export const RcSideNav: React.FC = ({ onClose, entries, width = '250px', iconSize = '20px', iconPadding = '25px', color = 'white', bgColor = '#484848', zIndex, menuEntryFontsize = '20px', bottomVSpace = '30px', children, }) => { zIndex = zIndex || rcConfig.zIndices.sideNav; return (
{entries && entries.map((entry, i) => { if (typeof entry.item === 'string') { return (
{entry.item}
); } return
{entry.item}
; })} {children && ( {children}
)}
); };