import { ActionIcon, Box, Group, Text, Tooltip, } from "@mantine/core"; import { IconMessage } from "@tabler/icons-react"; import classes from "./app-header.module.css"; import { BrandLogo } from "@/components/ui/brand-logo"; import TopMenu from "@/components/layouts/global/top-menu.tsx"; import { Link } from "react-router-dom"; import { useAtom, useSetAtom } from "jotai"; import { desktopSidebarAtom, mobileSidebarAtom, } from "@/components/layouts/global/hooks/atoms/sidebar-atom.ts"; import { aiChatWindowOpenAtom } from "@/features/ai-chat/atoms/ai-chat-atom.ts"; import { workspaceAtom } from "@/features/user/atoms/current-user-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 { SearchControl, SearchMobileControl, } from "@/features/search/components/search-control.tsx"; import { searchSpotlight, } from "@/features/search/constants.ts"; import { NotificationPopover } from "@/features/notification/components/notification-popover.tsx"; export function AppHeader() { const { t } = useTranslation(); const [mobileOpened] = useAtom(mobileSidebarAtom); const toggleMobile = useToggleSidebar(mobileSidebarAtom); const [desktopOpened] = useAtom(desktopSidebarAtom); const toggleDesktop = useToggleSidebar(desktopSidebarAtom); const [workspace] = useAtom(workspaceAtom); const setAiChatWindowOpen = useSetAtom(aiChatWindowOpenAtom); // AI chat entry point: only shown when the workspace enables it (A7 gate). const aiChatEnabled = workspace?.settings?.ai?.chat === true; return ( <> {APP_VERSION}
{aiChatEnabled && ( setAiChatWindowOpen((v) => !v)} > )}
); }