import React, { forwardRef } from 'react'; import { NestedNavigation as CoreNestedNavigation } from '@shoptet/ui-core-web'; import type { Exact, SafeOmit } from '@shoptet/utils'; import { Icon } from '../Icon/Icon'; import type { IconName } from '../Icon/IconName'; export interface NestedNavigationItemOwnProps { /** The row's label. */ label: string; /** Optional leading icon. */ icon?: IconName; /** Drills into the `NestedNavigation.Level` with this id. */ to: string; disabled?: boolean; } export interface NestedNavigationItemInheritedDivProps extends SafeOmit< React.HTMLAttributes, 'children' | 'className' | 'onClick' | 'onSelect' > {} export interface NestedNavigationItemProps extends NestedNavigationItemOwnProps, NestedNavigationItemInheritedDivProps {} export const NestedNavigationItem = forwardRef( function NestedNavigationItem({ label, icon, to, disabled, ...rest }, ref) { rest satisfies Exact; return ( {icon && ( )} {label} ); } ); NestedNavigationItem.displayName = 'NestedNavigation.Item';