2023-06-02 02:05:14 +03:00
|
|
|
import { resolveToRoot } from "../path"
|
2023-06-07 05:48:37 +03:00
|
|
|
import Darkmode from "./Darkmode"
|
|
|
|
import style from '../styles/header.scss'
|
2023-06-02 02:05:14 +03:00
|
|
|
|
|
|
|
export interface HeaderProps {
|
|
|
|
title: string
|
|
|
|
slug: string
|
|
|
|
}
|
|
|
|
|
2023-06-07 05:48:37 +03:00
|
|
|
export default function Header({ title, slug }: HeaderProps) {
|
2023-06-02 02:05:14 +03:00
|
|
|
const baseDir = resolveToRoot(slug)
|
|
|
|
return <header>
|
|
|
|
<h1><a href={baseDir}>{title}</a></h1>
|
2023-06-07 05:48:37 +03:00
|
|
|
<div class="spacer"></div>
|
|
|
|
<Darkmode />
|
2023-06-02 02:05:14 +03:00
|
|
|
</header>
|
|
|
|
}
|
2023-06-03 22:07:19 +03:00
|
|
|
|
2023-06-07 05:48:37 +03:00
|
|
|
Header.beforeDOMLoaded = Darkmode.beforeDOMLoaded
|
|
|
|
Header.css = style + Darkmode.css
|