({ section })
| 7 | import type { FC } from 'react'; |
| 8 | |
| 9 | const WithBadgeGroup: FC<{ section: string }> = ({ section }) => { |
| 10 | const badge = siteConfig.websiteBadges[section]; |
| 11 | |
| 12 | if (badge && dateIsBetween(badge.startDate, badge.endDate)) { |
| 13 | return ( |
| 14 | <BadgeGroup |
| 15 | as={Link} |
| 16 | badgeText={badge.title} |
| 17 | kind={badge.kind} |
| 18 | href={badge.link} |
| 19 | // Ensure that External Links have a target="_blank" and an arrow icon |
| 20 | // indicating that the link is external and should open in a new tab |
| 21 | target={/^https?:/.test(badge.link) ? '_blank' : undefined} |
| 22 | > |
| 23 | {badge.text} |
| 24 | </BadgeGroup> |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | return null; |
| 29 | }; |
| 30 | |
| 31 | export default WithBadgeGroup; |
nothing calls this directly
no test coverage detected