import { forwardRef, type ForwardedRef, type AnchorHTMLAttributes } from 'react' import { getIconProps, getTagProps, splitClassNameProp, } from '@pluralsight/headless-styles' import type { TagOptions } from '@pluralsight/headless-styles/types' import type { UsesIconProps } from './shared/types.ts' interface TagProps extends TagOptions, UsesIconProps, AnchorHTMLAttributes {} function TagEl(props: TagProps, ref: ForwardedRef) { const { children, size, icon, ...nativeProps } = props const pandoProps = getTagProps({ classNames: splitClassNameProp(props.className), size, }) const Icon = icon return ( {Icon && } {children} ) } export const Tag = forwardRef(TagEl)