# All files / src/Badge Badge.tsx

100% Statements 10/10
100% Branches 0/0
100% Functions 2/2
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    262x
    2x
    2x

    2x
    1x

    2x

    1x

    2x

    2x

    2x

     import React from 'react'
    import { addSubcomponents } from '../_utils/addSubcomponents'
    import { StyledBadge, StyledBadgeLabel } from './Badge.styles'
    import { BadgeLabelProps, BadgeProps } from './Badge.types'

    const Badge_ = React.forwardRef<HTMLDivElement, BadgeProps>((props, ref) => {
      return <StyledBadge ref={ref} {...props} />
    })

    const Label = React.forwardRef<HTMLSpanElement, BadgeLabelProps>(
      (props, ref) => {
        return <StyledBadgeLabel ref={ref} {...props} />
      }
    )

    Badge_.displayName = 'Badge'

    Label.displayName = 'Badge.Label'

    export const Badge = addSubcomponents(
      {
        Label,
      },
      Badge_
    )