2025-09-26 23:32:09 +03:00
|
|
|
import "./Header.css";
|
2025-09-26 22:54:56 +03:00
|
|
|
import { useLocation } from 'preact-iso';
|
2025-09-26 23:28:58 +03:00
|
|
|
import DownloadButton from './DownloadButton';
|
2025-09-26 22:54:56 +03:00
|
|
|
|
2025-09-27 01:16:33 +03:00
|
|
|
interface HeaderLink {
|
|
|
|
|
url: string;
|
|
|
|
|
text: string;
|
|
|
|
|
external?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const HEADER_LINKS: HeaderLink[] = [
|
|
|
|
|
{ url: "https://docs.triliumnotes.org/", text: "Documentation", external: true }
|
|
|
|
|
]
|
|
|
|
|
|
2025-09-26 22:54:56 +03:00
|
|
|
export function Header() {
|
|
|
|
|
const { url } = useLocation();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<header>
|
2025-09-26 23:24:28 +03:00
|
|
|
<div class="content-wrapper">
|
2025-09-26 23:40:05 +03:00
|
|
|
<a class="banner" href="/">
|
|
|
|
|
<img src="./src/assets/icon-color.svg" width="300" height="300" /> <span>Trilium Notes</span>
|
|
|
|
|
</a>
|
2025-09-26 23:24:28 +03:00
|
|
|
|
|
|
|
|
<nav>
|
2025-09-27 01:16:33 +03:00
|
|
|
{HEADER_LINKS.map(link => (
|
|
|
|
|
<a
|
|
|
|
|
href={link.url}
|
|
|
|
|
className={url === link.url && 'active'}
|
|
|
|
|
target={link.external && "_blank"}
|
|
|
|
|
>{link.text}</a>
|
|
|
|
|
))}
|
2025-09-26 23:24:28 +03:00
|
|
|
</nav>
|
2025-09-26 23:28:58 +03:00
|
|
|
|
|
|
|
|
<DownloadButton />
|
2025-09-26 23:24:28 +03:00
|
|
|
</div>
|
2025-09-26 22:54:56 +03:00
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|