Initial role user app
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import Link from "next/link";
|
||||
import type { Route } from "next";
|
||||
import type { CSSProperties } from "react";
|
||||
|
||||
type FilterNavOption = {
|
||||
href: Route;
|
||||
label: string;
|
||||
active: boolean;
|
||||
};
|
||||
|
||||
type FilterNavProps = {
|
||||
label: string;
|
||||
options: FilterNavOption[];
|
||||
};
|
||||
|
||||
export function FilterNav({ label, options }: FilterNavProps) {
|
||||
return (
|
||||
<nav
|
||||
aria-label={label}
|
||||
className="segmented"
|
||||
style={{ "--segment-count": options.length } as CSSProperties}
|
||||
>
|
||||
{options.map((option) => (
|
||||
<Link
|
||||
aria-current={option.active ? "page" : undefined}
|
||||
className={option.active ? "is-active" : undefined}
|
||||
href={option.href}
|
||||
key={option.label}
|
||||
>
|
||||
{option.label}
|
||||
</Link>
|
||||
))}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user