({ section })
| 9 | import type { FC } from 'react'; |
| 10 | |
| 11 | const WithBanner: FC<{ section: string }> = ({ section }) => { |
| 12 | const banner = siteConfig.websiteBanners[section]; |
| 13 | const t = useTranslations(); |
| 14 | |
| 15 | if (banner && dateIsBetween(banner.startDate, banner.endDate)) { |
| 16 | const bannerType = banner.type || 'default'; |
| 17 | |
| 18 | return ( |
| 19 | <Banner |
| 20 | type={banner.type} |
| 21 | aria-label={t(`components.banner.${bannerType}`)} |
| 22 | > |
| 23 | {banner.link ? ( |
| 24 | <Link href={banner.link}>{banner.text}</Link> |
| 25 | ) : ( |
| 26 | banner.text |
| 27 | )} |
| 28 | {banner.link && <ArrowUpRightIcon />} |
| 29 | </Banner> |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | return null; |
| 34 | }; |
| 35 | |
| 36 | export default WithBanner; |
nothing calls this directly
no test coverage detected