import type { HTMLAttributes, AriaAttributes } from 'react' import React, { forwardRef } from 'react' export type BadgeVariants = | 'info' | 'highlighted' | 'success' | 'neutral' | 'warning' | 'danger' export interface BadgeProps extends HTMLAttributes { /** * ID to find this component in testing tools (e.g.: cypress, testing library, and jest). */ testId?: string /** * Specifies the size variant. */ size?: 'small' | 'big' /** * Specifies the component variant. */ variant?: BadgeVariants /** * Enables counter badge. */ counter?: boolean /** * For accessibility purposes, adds an ARIA label to the element when `counter` is set to `true`. */ 'aria-label'?: AriaAttributes['aria-label'] } const Badge = forwardRef(function Badge( { testId = 'fs-badge', size = 'small', variant = 'neutral', counter = false, 'aria-label': ariaLabel, children, ...otherProps }: BadgeProps, ref ) { return (
{children}
) }) export default Badge