This commit is contained in:
isUnknown 2025-01-23 12:23:14 +01:00
parent 0923c9ec01
commit 28804ceba1
7 changed files with 267 additions and 181 deletions

View file

@ -1,11 +1,31 @@
<template>
<button v-if="page?.designToLight?.grades?.global">
{{ page.designToLight.grades.global.letter }}
</button>
<button :data-new="hasAlternatives ? true : undefined">{{ content }}</button>
</template>
<script setup>
import { storeToRefs } from "pinia";
import { usePageStore } from "../../stores/page";
import { computed } from "vue";
const { page } = storeToRefs(usePageStore());
const hasAlternatives = computed(() => {
return page.value.designToLight.length > 1;
});
const content = computed(() => {
if (hasAlternatives.value) return "new";
return page.value.designToLight[0].grades.global.letter;
});
</script>
<style scoped>
button {
position: fixed;
min-width: 4rem;
min-height: 2rem;
right: 2rem;
bottom: 2rem;
background-color: #000;
color: #fff;
}
</style>