import { useState } from "preact/hooks"; import { LangSelector, useNotifications, useTranslationContext } from "../index.browser.js"; import { ComponentChildren, Fragment, VNode, h } from "preact"; import logo from "../assets/logo-2021.svg"; interface Props { title: string; iconLinkURL: string; profileURL?: string; notificationURL?: string; children?: ComponentChildren; onLogout: (() => void) | undefined; sites: Array>; supportedLangs: string[] } export function Header({ title, profileURL, notificationURL, iconLinkURL, sites, onLogout, children }: Props): VNode { const { i18n } = useTranslationContext(); const [open, setOpen] = useState(false) const ns = useNotifications(); return
{title}
{sites.map((site) => { if (site.length !== 2) return; const [name, url] = site return })}
{!notificationURL ? undefined : } {!profileURL ? undefined : }
{ open && }
}