extended-brief working

This commit is contained in:
isUnknown 2024-11-19 14:10:35 +01:00
parent 984c8b7737
commit b99c05062f
20 changed files with 38 additions and 13 deletions

View file

@ -1,49 +0,0 @@
<template>
<main class="flex flex-col items-stretch | w-full" style="--row-gap: 2rem">
<header class="flex | bg-white | rounded-2xl | p-8">
<router-link
:to="'/' + page.parent"
class="btn btn--white"
data-icon="arrow-left"
>
<span>Retour au projet</span>
</router-link>
<button class="btn | ml-auto">Valider et envoyer le brief</button>
</header>
<component :is="stepsComponents[currentStep]" @update:step="changeStep" />
</main>
</template>
<script setup>
import { ref } from "vue";
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";
const stepsComponents = {
Intro,
ModeSelection,
Images,
PdfViewer,
};
const { page } = storeToRefs(usePageStore());
const currentStep = ref(setInitialStep());
function changeStep(stepName) {
currentStep.value = stepName;
}
function setInitialStep() {
const hasPDF = page.value.content.pdf.length !== 0;
const hasImages =
page.value.content.moodboard.length !== 0 ||
page.value.content.description.length !== 0;
const isEmpty = !hasPDF && !hasImages;
if (isEmpty) return "Intro";
if (hasImages) return "Images";
}
</script>