import React from 'react'
import { Menu, Search } from 'lucide-react'
import { Button, HeroIcon } from '@vertesia/ui/core'
import { useSidebarToggle } from './SidebarContext.js'
import { TitleBar } from './TitleBar.js'
import { useUITranslation } from '../i18n/index.js'
interface NavbarProps {
title?: string
onSearch?: (query: string) => void
logo?: React.ReactNode
children: React.ReactNode | React.ReactNode[]
}
export function Navbar({ children, logo, onSearch, title }: NavbarProps) {
return (
{logo}
{/* Separator shown only if search is displayed in mobile */}
{onSearch &&
}
{onSearch &&
}
{children}
)
}
interface SearchBoxProps {
onSearch?: (query: string) => void
}
function SearchBox({ }: SearchBoxProps) {
const { t } = useUITranslation();
return (
)
}
export function HamburgerButton() {
const { toggleDesktop, toggleMobile } = useSidebarToggle();
const toggle = () => {
if (window.innerWidth < 1024) {
toggleMobile();
} else {
toggleDesktop();
}
}
return (
<>
>
)
}
interface NavbarSeparatorProps {
visible?: "mobile" | "desktop"
}
export function NavbarSeparator({ visible }: NavbarSeparatorProps) {
let visibility = "";
if (visible) {
visibility = visible === "mobile" ? "lg:hidden" : "hidden lg:block"
}
return (
)
}
interface NavbarIconButtonProps {
title: string,
icon: HeroIcon,
onClick?: (ev: React.MouseEvent) => void;
}
export function NavbarIconButton({ title, icon: Icon, onClick }: NavbarIconButtonProps) {
return (
)
}
interface NavbarButtonProps {
children: React.ReactNode | React.ReactNode[]
onClick?: (ev: React.MouseEvent) => void;
}
export function NavbarButton({ children, onClick }: NavbarButtonProps) {
return (
)
}
interface NavbarLinkProps {
href: string
children: React.ReactNode | React.ReactNode[]
onClick?: (ev: React.MouseEvent) => void;
}
export function NavbarLink({ href, onClick, children }: NavbarLinkProps) {
return (
{children}
)
}