'use client'; import { clsx } from 'clsx'; import { Command as CommandPrimitive } from 'cmdk'; import { ComponentPropsWithRef, ComponentType } from 'react'; import { buildTypographyOverrides, getResponsiveBase, mapResponsiveSizeToTypography, type Responsive, type Tone, } from '../../styles'; import { Cluster } from '../cluster'; import { menuItemRecipe, menuItemIcon } from '../menu/menu-item.css'; import type { MenuItemVariants } from '../menu/menu-item.css'; export type CommandItemProps = ComponentPropsWithRef< typeof CommandPrimitive.Item > & { inset?: boolean; icon?: ComponentType<{ className?: string }>; tone?: Tone; size?: Responsive>; }; export function CommandItem({ className, inset, icon: IconComp, children, tone, size, ...props }: CommandItemProps) { const baseSize = getResponsiveBase(size) ?? 'md'; const typographySize = mapResponsiveSizeToTypography(size); const typographyOverrides = buildTypographyOverrides({ variant: 'body', size: typographySize, }); return ( {IconComp && } {children} ); }