({
author,
authorLink,
date
}: {
author?: string;
authorLink?: string;
date: string;
})
| 72 | } |
| 73 | |
| 74 | export function Byline({ |
| 75 | author, |
| 76 | authorLink, |
| 77 | date |
| 78 | }: { |
| 79 | author?: string; |
| 80 | authorLink?: string; |
| 81 | date: string; |
| 82 | }) { |
| 83 | let formattedDate = new Date(date).toLocaleDateString('en-US', { |
| 84 | year: 'numeric', |
| 85 | month: 'long', |
| 86 | day: 'numeric' |
| 87 | }); |
| 88 | |
| 89 | return ( |
| 90 | <div |
| 91 | className={style({ |
| 92 | font: 'detail', |
| 93 | width: 'full', |
| 94 | maxWidth: '--text-width', |
| 95 | marginX: 'auto', |
| 96 | marginTop: 4 |
| 97 | })}> |
| 98 | {author && ( |
| 99 | <> |
| 100 | {'By '} |
| 101 | <span itemProp="author" itemScope itemType="https://schema.org/Person"> |
| 102 | {authorLink ? ( |
| 103 | <> |
| 104 | <meta itemProp="url" content={authorLink} /> |
| 105 | <Link href={authorLink} isQuiet rel="author" target="_blank"> |
| 106 | <span itemProp="name">{author}</span> |
| 107 | </Link> |
| 108 | </> |
| 109 | ) : ( |
| 110 | <span itemProp="name">{author}</span> |
| 111 | )} |
| 112 | </span> |
| 113 | {' · '} |
| 114 | </> |
| 115 | )} |
| 116 | <time itemProp="datePublished" dateTime={date}> |
| 117 | {formattedDate} |
| 118 | </time> |
| 119 | </div> |
| 120 | ); |
| 121 | } |
| 122 | |
| 123 | export function Time({date}: {date: string}) { |
| 124 | return ( |
nothing calls this directly
no outgoing calls
no test coverage detected