summaryrefslogtreecommitdiff
path: root/src/components/Header.tsx
blob: a3b344dde9e1f91a0788c88e45b765d203f4b979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { ComponentChildren } from 'preact';
import Button from './Button.tsx';
import './Header.css';

export interface HeaderProps {
	children: ComponentChildren;
	class?: string;
	title?: string;
}

const Header = ({ children, title, ...props }: HeaderProps) => {
	return (
		<header class={(props.class || '') + ' __Header'}>
			{!!title && <Button kind="ghost" class="title" href="/">{title}</Button>}
			<nav>
				{children}
			</nav>
		</header>
	);
};

export default Header;