mirror of
https://github.com/meshtastic/meshtastic.git
synced 2025-03-05 21:00:08 -08:00
19 lines
486 B
TypeScript
19 lines
486 B
TypeScript
|
import React from 'react';
|
||
|
|
||
|
export const HeaderText = ({type, text, link}): JSX.Element => {
|
||
|
|
||
|
const anchor = React.createElement(
|
||
|
'a',
|
||
|
{className: "hash-link", href: `#${link}`, title: "Direct link to heading"}
|
||
|
)
|
||
|
|
||
|
const heading = React.createElement(
|
||
|
type || 'h1',
|
||
|
link ? {className: "anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module"} : null,
|
||
|
text, link ? anchor : null
|
||
|
)
|
||
|
|
||
|
return heading
|
||
|
|
||
|
};
|