import { Link, useNavigate, useParams, useSearchParams } from "react-router"; import { Fragment } from "react"; import { useTranslation } from "react-i18next"; import type { KnowledgeBaseDto } from "../dtos/KnowledgeBaseDto"; import clsx from "clsx"; import ColorBackgroundUtils from "~/utils/shared/colors/ColorBackgroundUtils"; import ColorTextUtils from "~/utils/shared/colors/ColorTextUtils"; import ColorFocusUtils from "~/utils/shared/colors/ColorFocusUtils"; import ColorRingUtils from "~/utils/shared/colors/ColorRingUtils"; import ColorGradientUtils from "~/utils/shared/colors/ColorGradientUtils"; import { logoLight, logoDark } from "~/assets/brand/default"; import KnowledgeBaseUtils from "../utils/KnowledgeBaseUtils"; import KbSearch from "./KbSearch"; interface Props { kb: KnowledgeBaseDto; // currentVersion: string | undefined; withTitleAndDescription: boolean; withSearch?: boolean; } export default function KbHeader({ kb, withTitleAndDescription, withSearch = true }: Props) { const { t } = useTranslation(); const navigate = useNavigate(); const params = useParams(); const [searchParams] = useSearchParams(); const logoAlt = t("knowledgeBase.header.logoAlt", { title: kb.title }); return (
{kb.logo === "light" ? ( {logoAlt} ) : kb.logo === "dark" ? ( {logoAlt} ) : ( {logoAlt} )} {!withTitleAndDescription && ( | {kb.title} )}
{kb.links.map((link) => { return ( {link.name} ); })}
{kb.languages.length > 1 && ( )}
{withTitleAndDescription && (

{kb.title}

{kb.description}

)} {withSearch && }
); }