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

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

/*-- Types --*/

export interface MenuItemButtonProps {}

/*-- Main --*/

export const MenuItemButton = forwardRef<'button', MenuItemButtonProps>(
  function MenuItemButton(
    { as = 'button', children, className, ...rest },
    ref,
  ) {
    const cn = clsx(className, css.button);

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