feat: add an isAdmin check

This commit is contained in:
Shivam Mishra
2024-04-15 14:34:02 +05:30
parent ce7057bd43
commit 25c0784f13
2 changed files with 30 additions and 15 deletions
@@ -11,6 +11,7 @@
"AVAILABLE_ON": "SLA management is available on the <span class=\"font-medium text-slate-900\">Business and Enterprise</span> plans only.",
"UPGRADE_PROMPT": "Upgrade now to get access to advanced features like team management, automations, custom attributes, and more.",
"UPGRADE_NOW": "Upgrade now",
"ASK_ADMIN": "Ask your admin to upgrade and get access to advanced features like team management, automations, custom attributes, and more.",
"CANCEL_ANYTIME": "You can change or cancel your plan anytime"
},
"LIST": {
@@ -9,6 +9,13 @@ const { proxy } = getCurrentInstance();
const route = proxy.$route;
const router = proxy.$router;
defineProps({
isAdmin: {
type: Boolean,
default: false,
},
});
function routeToBilling() {
const accountId = route.params.accountId;
@@ -38,21 +45,28 @@ function routeToBilling() {
class="text-sm font-normal tracking-[0.5%] mt-4"
v-html="$t('SLA.PAYWALL.AVAILABLE_ON')"
/>
<p class="text-sm font-normal tracking-[0.5%]">
{{ $t('SLA.PAYWALL.UPGRADE_PROMPT') }}
</p>
<woot-button
color-scheme="primary"
class="w-full mt-2 text-center rounded-xl"
size="expanded"
is-expanded
@click="routeToBilling"
>
{{ $t('SLA.PAYWALL.UPGRADE_NOW') }}
</woot-button>
<p class="mt-2 text-xs tracking-tighter text-center">
{{ $t('SLA.PAYWALL.CANCEL_ANYTIME') }}
</p>
<template v-if="isAdmin">
<p class="text-sm font-normal tracking-[0.5%]">
{{ $t('SLA.PAYWALL.UPGRADE_PROMPT') }}
</p>
<woot-button
color-scheme="primary"
class="w-full mt-2 text-center rounded-xl"
size="expanded"
is-expanded
@click="routeToBilling"
>
{{ $t('SLA.PAYWALL.UPGRADE_NOW') }}
</woot-button>
<p class="mt-2 text-xs tracking-tighter text-center">
{{ $t('SLA.PAYWALL.CANCEL_ANYTIME') }}
</p>
</template>
<template v-else>
<p class="text-sm font-normal tracking-[0.5%]">
{{ $t('SLA.PAYWALL.ASK_ADMIN') }}
</p>
</template>
</div>
</base-empty-state>
</template>