import React from 'react'

import { type TooltipHeadlineProps } from './ChartTooltipTypes'
import styles from './_charts-tooltip.module.scss'

export const TooltipHeadline = ({
  text,
  subText,
}: TooltipHeadlineProps): React.JSX.Element => {
  return (
    <div className={styles.tooltipHeaderContainer}>
      <div className={styles.primaryText}>{text}</div>
      {subText ? <span>{subText}</span> : null}
    </div>
  )
}

export default TooltipHeadline
