MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / WithBadgeGroup

Function WithBadgeGroup

apps/site/components/withBadgeGroup.tsx:9–29  ·  view source on GitHub ↗
({ section })

Source from the content-addressed store, hash-verified

7import type { FC } from 'react';
8
9const 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
31export default WithBadgeGroup;

Callers

nothing calls this directly

Calls 1

dateIsBetweenFunction · 0.90

Tested by

no test coverage detected