designtopack/src/views/ClientBrief.vue

47 lines
1.4 KiB
Vue
Raw Normal View History

2024-09-26 19:14:20 +02:00
<template>
<main class="flex flex-col items-stretch | w-full">
2024-10-02 15:33:57 +02:00
<header class="flex | bg-white | rounded-2xl | p-8 mb-16">
<router-link :to="'/' + page.parent">
<h1 class="font-serif | px-8">Retour au projet</h1>
</router-link>
<button class="btn | ml-auto">Valider et envoyer le brief</button>
</header>
2024-09-26 19:14:20 +02:00
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
</main>
</template>
<script setup>
import { ref } from "vue";
2024-10-09 17:39:05 +02:00
import Intro from "../components/project/client-brief/Intro.vue";
import ModeSelection from "../components/project/client-brief/ModeSelection.vue";
import Images from "../components/project/client-brief/Images.vue";
import PdfViewer from "../components/project/client-brief/PdfViewer.vue";
import { usePageStore } from "../stores/page";
import { storeToRefs } from "pinia";
2024-09-26 19:14:20 +02:00
const stepsComponents = {
Intro,
ModeSelection,
Images,
PdfViewer,
2024-09-26 19:14:20 +02:00
};
const { page } = storeToRefs(usePageStore());
const currentStep = ref(setInitialStep());
2024-09-26 19:14:20 +02:00
function changeStep(stepName) {
currentStep.value = stepName;
}
function setInitialStep() {
const hasPDF = page.value.content.clientbriefpdf.length !== 0;
const hasImages =
2024-10-16 15:03:20 +02:00
page.value.content.moodboard.length !== 0 ||
page.value.content.description.length !== 0;
const isEmpty = !hasPDF && !hasImages;
if (isEmpty) return "Intro";
if (hasPDF) return "PdfViewer";
if (hasImages) return "Images";
}
2024-09-26 19:14:20 +02:00
</script>