'use client'; import { Fragment } from "react"; import { Popover, Transition } from "@headlessui/react"; import clsx from "clsx"; import ChevronDownIcon from "../icons/ChevronDownIcon"; import { NavbarItemDto } from "../../../modules/pageBlocks/components/blocks/marketing/header/HeaderBlockUtils"; import { useApp } from "../../../hooks"; import Link from "next/link"; interface Props { title: string; items?: NavbarItemDto[]; className?: string; } export default function HeaderFlyoutItem({ title, items, className }: Props) { const { t } = useApp(); return ( {({ open }) => ( <> {title} {({ close }) => (
{items?.map((item) => ( {item.path?.startsWith("https:") ? ( close()} href={item.path ?? "#"} target={item.target} className="-m-3 block rounded-md p-3 transition duration-150 ease-in-out hover:bg-gray-50 dark:hover:bg-gray-900" >

{t(item.title)}

{item.description &&

{t(item.description)}

}
) : ( close()} href={item.path ?? "#"} target={item.target} className="-m-3 block rounded-md p-3 transition duration-150 ease-in-out hover:bg-gray-50 dark:hover:bg-gray-900" >

{t(item.title)}

{item.description &&

{t(item.description)}

} )}
))}
)}
)}
); }