mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
31 lines
627 B
Vue
31 lines
627 B
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
import type { EnterpriseEditionFeatureValue } from '@/Interface';
|
|
import { useSettingsStore } from '@/stores/settings.store';
|
|
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
features: EnterpriseEditionFeatureValue[];
|
|
}>(),
|
|
{
|
|
features: () => [],
|
|
},
|
|
);
|
|
|
|
const settingsStore = useSettingsStore();
|
|
|
|
const canAccess = computed(() =>
|
|
props.features.reduce(
|
|
(acc: boolean, feature) => acc && !!settingsStore.isEnterpriseFeatureEnabled[feature],
|
|
true,
|
|
),
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<slot v-if="canAccess" />
|
|
<slot v-else name="fallback" />
|
|
</div>
|
|
</template>
|