import type { HTMLAttributes } from 'react' import React, { forwardRef } from 'react' import { LinkButton } from '../..' import { useBannerText } from './BannerText' export interface BannerTextContentProps extends HTMLAttributes { /** * The content for the h2 tag. */ title: string /** * The content for the p tag below the h2. */ caption: string /** * The href used at the link. */ link: string /** * The label used at the link. */ linkText: string /** * Specify if the link opens in a new tab. */ linkTargetBlank?: boolean /** * ID to find this component in testing tools (e.g.: cypress, testing library, and jest). */ testId?: string } const BannerTextContent = forwardRef( function BannerTextContent( { testId = 'fs-banner-text-content', title, caption, link, linkText, linkTargetBlank, ...otherProps }, ref ) { const { variant, colorVariant } = useBannerText() return (

{title}

{variant === 'secondary' && caption &&

{caption}

}
{linkText}
) } ) export default BannerTextContent