From 85a1a4a4df318d19d8b7adf10c0656f3c2205a5f Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 6 Jun 2024 14:09:18 +0200 Subject: [PATCH] feat(components): add PrimaryNavigationMenu component This commit introduces a new component, PrimaryNavigationMenu, to the components directory. This component is responsible for rendering the main navigation menu of the application. It also includes the logic for mapping and displaying a list of features in the menu. --- src/components/primary-nav.tsx | 147 +++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 src/components/primary-nav.tsx diff --git a/src/components/primary-nav.tsx b/src/components/primary-nav.tsx new file mode 100644 index 0000000..d92720b --- /dev/null +++ b/src/components/primary-nav.tsx @@ -0,0 +1,147 @@ +"use client" + +import * as React from "react" +import Link from "next/link" + +import { cn } from "@/lib/utils" +import { + NavigationMenu, + NavigationMenuContent, + NavigationMenuItem, + NavigationMenuLink, + NavigationMenuList, + NavigationMenuTrigger, + navigationMenuTriggerStyle, +} from "@/components/ui/navigation-menu" +import Image from "next/image"; +import {Boxes, Info} from "lucide-react"; + +const components: { title: string; href: string; description: string }[] = [ + { + title: "Alert Dialog", + href: "/docs/primitives/alert-dialog", + description: + "A modal dialog that interrupts the user with important content and expects a response.", + }, + { + title: "Hover Card", + href: "/docs/primitives/hover-card", + description: + "For sighted users to preview content available behind a link.", + }, + { + title: "Progress", + href: "/docs/primitives/progress", + description: + "Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.", + }, + { + title: "Scroll-area", + href: "/docs/primitives/scroll-area", + description: "Visually or semantically separates content.", + }, + { + title: "Tabs", + href: "/docs/primitives/tabs", + description: + "A set of layered sections of content—known as tab panels—that are displayed one at a time.", + }, + { + title: "Tooltip", + href: "/docs/primitives/tooltip", + description: + "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.", + }, +] + +export function PrimaryNavigationMenu() { + return ( + + + + Getting started + + + + + + Features + +
    + {components.map((component) => ( + + {component.description} + + ))} +
+
+
+ + + + Documentation + + + +
+
+ ) +} + +const ListItem = React.forwardRef< + React.ElementRef<"a">, + React.ComponentPropsWithoutRef<"a"> +>(({ className, title, children, ...props }, ref) => { + return ( +
  • + + +
    {title}
    +

    + {children} +

    +
    +
    +
  • + ) +}) +ListItem.displayName = "ListItem"