({currentPage, parentPage, isLongForm}: SubpageHeaderProps)
| 243 | } |
| 244 | |
| 245 | export function SubpageHeader({currentPage, parentPage, isLongForm}: SubpageHeaderProps) { |
| 246 | return ( |
| 247 | <div |
| 248 | className={style({ |
| 249 | display: 'flex', |
| 250 | flexDirection: 'column', |
| 251 | gap: 4, |
| 252 | maxWidth: '--text-width', |
| 253 | marginX: 'auto', |
| 254 | marginBottom: 40 |
| 255 | })}> |
| 256 | <div className={style({display: 'flex', alignItems: 'center', gap: 2})}> |
| 257 | <TitleLink href={parentPage?.url}> |
| 258 | {parentPage?.exports?.title ?? |
| 259 | parentPage?.tableOfContents?.[0]?.title ?? |
| 260 | parentPage?.name} |
| 261 | </TitleLink> |
| 262 | <ChevronRightIcon styles={iconStyle({size: 'XS'})} /> |
| 263 | </div> |
| 264 | <H1 itemProp="headline" isLongForm={isLongForm}> |
| 265 | {currentPage.tableOfContents?.[0].title} |
| 266 | </H1> |
| 267 | {currentPage.exports?.author && ( |
| 268 | <Byline |
| 269 | author={currentPage.exports.author} |
| 270 | authorLink={currentPage.exports.authorLink} |
| 271 | date={currentPage.exports.date} |
| 272 | /> |
| 273 | )} |
| 274 | {currentPage.exports?.date && !currentPage.exports?.author && ( |
| 275 | <Time date={currentPage.exports.date} /> |
| 276 | )} |
| 277 | </div> |
| 278 | ); |
| 279 | } |
| 280 | |
| 281 | export function Byline({ |
| 282 | author, |
nothing calls this directly
no test coverage detected