import { useRouter } from '@help-center/hooks/useRouter'; import { useGlobalSyncStore } from '@help-center/state/globals-sync'; import { useActivityStore } from '@shared/state/activity'; import { __, isRTL } from '@wordpress/i18n'; import { chevronLeft, chevronRight, closeSmall, Icon, reset, } from '@wordpress/icons'; import classNames from 'classnames'; const { partnerLogo, partnerName } = window.extSharedData; export const Topbar = () => { const { visibility, setVisibility } = useGlobalSyncStore(); const { incrementActivity } = useActivityStore(); const { current, history } = useRouter(); const handleClose = () => { incrementActivity(`hc-close-button-when-${visibility}`); setVisibility('closed'); }; const isMinimized = visibility === 'minimized'; const toggleMinimized = () => { const nextState = isMinimized ? 'open' : 'minimized'; incrementActivity(`hc-toggle-button-${nextState}`); setVisibility(nextState); }; return (
{/* biome-ignore lint: soon to be removed anyway */}
{current?.title && ( {current.title} )}
); }; const LogoOrBackButton = () => { const { goBack, history } = useRouter(); const { visibility } = useGlobalSyncStore(); if (history.length > 1 && visibility === 'open') { return ( ); } return partnerLogo ? (
{partnerName}
) : null; };