import { useId, useMemo } from 'react' import Block from '../Primitives/Block/Block' import { Tag, TagVariant } from '../Tags' import { SplitTagProps } from './types' const SplitTag = ({ primaryTag, secondaryTag, size, shape, ...props }: SplitTagProps) => { const baseId = useId() const splitTagId = `${baseId}-split-tag` const primaryTagId = `${baseId}-primary-tag` const secondaryTagId = `${baseId}-secondary-tag` // Extract aria-label from props if provided const ariaLabel = (props as { 'aria-label'?: string })['aria-label'] // eslint-disable-next-line @typescript-eslint/no-unused-vars const { 'aria-label': _, ...restProps } = props as { 'aria-label'?: string [key: string]: unknown } const splitTagLabel = useMemo(() => { // Use provided aria-label if available, otherwise generate from text if (ariaLabel) { return ariaLabel } const parts: string[] = [] if (primaryTag?.text) { parts.push(primaryTag.text) } if (secondaryTag?.text) { parts.push(secondaryTag.text) } return parts.length > 0 ? parts.join(': ') : 'Split tag' }, [primaryTag?.text, secondaryTag?.text, ariaLabel]) return ( {primaryTag ? ( ) : null} {secondaryTag ? ( ) : null} ) } SplitTag.displayName = 'SplitTag' export default SplitTag