import { t } from 'i18next'; import { ChevronLeft } from 'lucide-react'; import { Link } from 'react-router-dom'; import { flagsHooks } from '@/hooks/flags-hooks'; import { authenticationSession } from '@/lib/authentication-session'; import { ActivepiecesClientEventName } from 'ee-embed-sdk'; import { useEmbedding } from '../embed-provider'; import { Button } from './button'; import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip'; const HomeButtonWrapper = ({ children }: { children: React.ReactNode }) => { const { embedState } = useEmbedding(); if (embedState.emitHomeButtonClickedEvent) { const handleClick = () => { window.parent.postMessage( { type: ActivepiecesClientEventName.CLIENT_BUILDER_HOME_BUTTON_CLICKED, data: { route: '/flows', }, }, '*', ); }; return
{children}
; } return ( {children} ); }; const HomeButton = () => { const { embedState } = useEmbedding(); const branding = flagsHooks.useWebsiteBranding(); const showBackButton = embedState.homeButtonIcon === 'back'; return ( <> {!embedState.hideHomeButtonInBuilder && ( {!showBackButton && ( {t('Go to Dashboard')} )} )} ); }; HomeButton.displayName = 'HomeButton'; export { HomeButton };