designtopack/src/components/design-to-light/DTLButton.vue

32 lines
692 B
Vue
Raw Normal View History

<template>
2025-01-23 12:23:14 +01:00
<button :data-new="hasAlternatives ? true : undefined">{{ content }}</button>
</template>
<script setup>
import { storeToRefs } from "pinia";
import { usePageStore } from "../../stores/page";
2025-01-23 12:23:14 +01:00
import { computed } from "vue";
const { page } = storeToRefs(usePageStore());
2025-01-23 12:23:14 +01:00
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>
2025-01-23 12:23:14 +01:00
<style scoped>
button {
position: fixed;
min-width: 4rem;
min-height: 2rem;
right: 2rem;
bottom: 2rem;
background-color: #000;
color: #fff;
}
</style>