feat: add showOnlyOnCloud flag

This commit is contained in:
Shivam Mishra
2025-01-23 18:08:41 +05:30
parent 2f4bf9d009
commit eff39fbbf5
5 changed files with 23 additions and 3 deletions
@@ -15,11 +15,14 @@ const props = defineProps({
activeChild: { type: Object, default: undefined },
});
const { isAllowed } = useSidebarContext();
const { isAllowed, isOnChatwootCloud } = useSidebarContext();
const scrollableContainer = ref(null);
const accessibleItems = computed(() =>
props.children.filter(child => isAllowed(child.to))
props.children.filter(child => {
if (child.showOnlyOnCloud && isOnChatwootCloud.value) return false;
return child.to && isAllowed(child.to);
})
);
const hasAccessibleItems = computed(() => {