import { subtitleVariants } from "./variants"

import type { SubtitleProps } from "./subtitle"

export default function Subtitle({
  children,
  className = "",
  color,
  hideEmpty = true,
  textTransform,
}: SubtitleProps) {
  if (hideEmpty && !children) {
    return null
  }
  const classNames = subtitleVariants({
    className,
    color,
    textTransform,
  })
  return <p className={classNames}>{children}</p>
}
