import { Badge, Group, Text, Tooltip } from "@mantine/core"; import classes from "./app-header.module.css"; import React from "react"; import TopMenu from "@/components/layouts/global/top-menu.tsx"; import { Link } from "react-router-dom"; import APP_ROUTE from "@/lib/app-route.ts"; import { useAtom } from "jotai"; import { desktopSidebarAtom, mobileSidebarAtom, } from "@/components/layouts/global/hooks/atoms/sidebar-atom.ts"; import { useToggleSidebar } from "@/components/layouts/global/hooks/hooks/use-toggle-sidebar.ts"; import SidebarToggle from "@/components/ui/sidebar-toggle-button.tsx"; import { useTranslation } from "react-i18next"; import useTrial from "@/ee/hooks/use-trial.tsx"; import { isCloud } from "@/lib/config.ts"; const links = [{ link: APP_ROUTE.HOME, label: "Home" }]; export function AppHeader() { const { t } = useTranslation(); const [mobileOpened] = useAtom(mobileSidebarAtom); const toggleMobile = useToggleSidebar(mobileSidebarAtom); const [desktopOpened] = useAtom(desktopSidebarAtom); const toggleDesktop = useToggleSidebar(desktopSidebarAtom); const { isTrial, trialDaysLeft } = useTrial(); const isHomeRoute = location.pathname.startsWith("/home"); const items = links.map((link) => ( {t(link.label)} )); return ( <> {!isHomeRoute && ( <> )} Docmost {items} {isCloud() && isTrial && trialDaysLeft !== 0 && ( {trialDaysLeft === 1 ? "1 day left" : `${trialDaysLeft} days left`} )} ); }