add limit banner

This commit is contained in:
Emily
2024-06-11 18:17:22 +02:00
parent fc0f39dd11
commit e1dfc5fa1c
3 changed files with 61 additions and 1 deletions

View File

@@ -11,8 +11,19 @@ const eventsStackedSelectIndex = ref<number>(0);
const route = useRoute();
const limitsInfo = ref<{
limited: boolean,
maxLimit: number,
limit: number,
total: number,
percent: number
}>();
onMounted(async () => {
if (route.query.just_logged) return location.href = '/';
limitsInfo.value = await $fetch("/api/project/limits_info", signHeaders());
});
@@ -69,6 +80,16 @@ const selectLabelsEvents = [
<div :key="'home-' + isLiveDemo()" v-if="projects && activeProject && firstInteraction">
<div class="w-full px-4 py-2">
<div v-if="limitsInfo && limitsInfo.limited"
class="bg-orange-600 justify-center flex gap-2 py-2 px-4 font-semibold text-[1.2rem] rounded-lg">
<div class="poppins text-text"> Limit reached </div>
<NuxtLink to="/plans" class="poppins text-[#393972] underline cursor-pointer">
Upgrade project
</NuxtLink>
</div>
</div>
<DashboardTopSection></DashboardTopSection>
<DashboardTopCards></DashboardTopCards>