You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
799 B

import sass from "https://deno.land/x/denosass@1.0.6/mod.ts";
import { Props } from "../types.d.ts";
import { h } from "../jsx.ts";
interface BaseHeaderProps extends Props {
id?: string;
entries: {
name: string;
href: string;
element?: unknown;
}[];
currentHref: string;
}
export default (props: BaseHeaderProps) => (
<header id={props.id} class="header">
{props.entries
.map((entry) =>
entry.element ? (
entry.element
) : entry.href !== props.currentHref ? (
<a href={entry.href}>{entry.name}</a>
) : (
<p id="selected-header-element">{entry.name}</p>
)
)
.join("")}
</header>
);