import React from 'react';
import { clsx } from 'clsx';

import { forwardRef } from '../utils/react';
import { Box } from '../box';
import * as css from './menu-item-icon.css';

/*-- Types --*/

export interface MenuItemIconProps {}

/*-- Main --*/

export const MenuItemIcon = forwardRef<'span', MenuItemIconProps>(
  function MenuItemIcon({ as = 'span', children, className, ...rest }, ref) {
    const cn = clsx(className, css.icon);

    return (
      <Box ref={ref} as={as} className={cn} {...rest}>
        {children}
      </Box>
    );
  },
);
