import { $, component$, Slot } from '@builder.io/qwik' import { useNavigate } from '@builder.io/qwik-city' export default component$<{ withBackButton?: boolean; backButtonPlacement?: 'start' | 'end' }>( ({ withBackButton, backButtonPlacement = 'start' }) => { const nav = useNavigate() const goBack = $(() => { if (window.history.length > 1) { window.history.back() } else { nav('/explore') } }) const backButton = !withBackButton ? ( // eslint-disable-next-line qwik/single-jsx-root <> ) : (
) return (
{backButtonPlacement === 'start' && backButton} {backButtonPlacement === 'end' &&
{backButton}
}
) } )