forked from fahrPool/fahrPool
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import Link from "next/link";
|
|
|
|
export type AuslastungTab = "jetzt" | "planung";
|
|
|
|
const TABS: { id: AuslastungTab; label: string }[] = [
|
|
{ id: "jetzt", label: "Jetzt" },
|
|
{ id: "planung", label: "Planung" },
|
|
];
|
|
|
|
export function AuslastungTabs({ aktiv }: { aktiv: AuslastungTab }) {
|
|
return (
|
|
<nav aria-label="Ansicht" className="flex gap-2">
|
|
{TABS.map((tab) => (
|
|
<Link
|
|
key={tab.id}
|
|
href={`/auslastung?tab=${tab.id}`}
|
|
aria-current={tab.id === aktiv ? "page" : undefined}
|
|
className={`flex min-h-11 items-center rounded-md px-4 font-medium focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-performance-blue ${
|
|
tab.id === aktiv
|
|
? "bg-performance-blue text-white"
|
|
: "border border-asphalt-grey bg-white text-asphalt-grey hover:bg-aluminium-grey"
|
|
}`}
|
|
>
|
|
{tab.label}
|
|
</Link>
|
|
))}
|
|
<Link
|
|
href="/kalender"
|
|
className="flex min-h-11 items-center rounded-md border border-asphalt-grey bg-white px-4 font-medium text-asphalt-grey hover:bg-aluminium-grey focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-performance-blue"
|
|
>
|
|
Kalender
|
|
</Link>
|
|
</nav>
|
|
);
|
|
}
|