Files
sweet/www/components/NavigationBar.tsx
T
Luca Casonato 80598d07fd feat: use import maps instead of deps files (#209)
This commit updates fresh to use import maps instead of deps files in generated projects.
2022-05-23 19:35:15 +02:00

37 lines
738 B
TypeScript

/** @jsx h */
import { h } from "$fresh/runtime.ts";
import { tw } from "../utils/twind.ts";
export default function NavigationBar(props: { active: string }) {
const items = [
{
name: "Home",
href: "/",
},
{
name: "Docs",
href: "/docs",
},
];
return (
<nav class={tw`bg-green-200 py-2`}>
<ul class={tw`flex justify-center gap-8 mx-4`}>
{items.map((item) => (
<li>
<a
href={item.href}
class={tw`text-gray-600 hover:underline ${
props.active == item.href ? "font-bold" : ""
}`}
>
{item.name}
</a>
</li>
))}
</ul>
</nav>
);
}