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";
|
|
|
|
|
import Header from "../components/project/Header.vue";
|
|
|
|
|
import Intro from "../components/project/ClientBrief/Intro.vue";
|
|
|
|
|
import ModeSelection from "../components/project/ClientBrief/ModeSelection.vue";
|
2024-10-02 15:29:31 +02:00
|
|
|
import Images from "../components/project/ClientBrief/Images.vue";
|
|
|
|
|
import { usePageStore } from "../stores/page";
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
const stepsComponents = {
|
|
|
|
|
Intro,
|
|
|
|
|
ModeSelection,
|
2024-10-02 15:29:31 +02:00
|
|
|
Images,
|
2024-09-26 19:14:20 +02:00
|
|
|
};
|
|
|
|
|
|
2024-10-02 15:29:31 +02:00
|
|
|
const { page } = usePageStore();
|
|
|
|
|
|
|
|
|
|
const currentStep = ref(setInitialStep());
|
2024-09-26 19:14:20 +02:00
|
|
|
|
|
|
|
|
function changeStep(stepName) {
|
|
|
|
|
currentStep.value = stepName;
|
|
|
|
|
}
|
2024-10-02 15:29:31 +02:00
|
|
|
|
|
|
|
|
function setInitialStep() {
|
|
|
|
|
const hasPDF = page.content.clientbriefpdf.length !== 0;
|
|
|
|
|
const hasImages = page.content.clientbriefimages.length !== 0;
|
|
|
|
|
const isEmpty = !hasPDF && !hasImages;
|
|
|
|
|
if (isEmpty) return "Intro";
|
|
|
|
|
if (hasPDF) return "PDF";
|
|
|
|
|
if (hasImages) return "Images";
|
|
|
|
|
}
|
2024-09-26 19:14:20 +02:00
|
|
|
</script>
|