import { computed, defineComponent, onMounted, reactive, ref, Transition, } from 'vue'; import { BCMSHelpItem } from '.'; import { useTranslation } from '../../../translations'; import { DefaultComponentProps } from '../../_default'; import { BCMSTimestampDisplay } from '../..'; import { useRoute } from 'vue-router'; import type { BCMSTranslationsFooterDocsKeyNames } from '@ui/types'; const component = defineComponent({ props: { ...DefaultComponentProps, }, setup(props) { const route = useRoute(); props = reactive(props); const translations = computed(() => { return useTranslation(); }); const helpContainer = ref(null); const show = ref(false); const toggler = ref(null); function handleClick() { if (!show.value) { show.value = true; } else { show.value = false; } } function hide() { show.value = false; } const getManagerName = computed(() => { const pathSplit = route.path.split('/'); let name = pathSplit[2]; if (pathSplit[4] && pathSplit[4] === 'e') { name = pathSplit[4]; } return name as BCMSTranslationsFooterDocsKeyNames; }); let isMac = false; onMounted(() => { const platform = (navigator as any)?.userAgentData?.platform || navigator?.platform || 'unknown'; isMac = platform?.toLowerCase().includes('mac'); }); return () => { return (
{show.value === true && (
(show.value = false)} > {translations.value.layout.footer.help .navigation(getManagerName.value) .sort((a, b) => a.level - b.level) .map((item, index) => { const nextItemLevel = translations.value.layout.footer.help.navigation( getManagerName.value, )[index + 1]; return ( <> hide()} /> {nextItemLevel && item.level < nextItemLevel.level && (
)} ); })}
{translations.value.layout.footer.help.updated}
)}
); }; }, }); export default component;