import { defineStore } from "pinia"; import { usePageStore } from "./page"; export const useProjectStore = defineStore("project", () => { const { page } = usePageStore(); const stepsLabels = { Brief: "Votre brief", proposal: "Proposition commerciale", extendedBrief: "Brief enrichi", industrialIdeation: "Idéation industrielle", virtualSample: "Échantillon virtuel", physicalSample: "Échantillon physique", }; function setStatus(steps, currentStepId, targetStep) { const currentStepIndex = steps.findIndex( (item) => item.id === currentStepId ); const stepIndex = steps.findIndex((item) => item.id === targetStep.id); if (currentStepIndex === stepIndex) { return "in-progress"; } if (currentStepIndex > stepIndex) { return "done"; } if (currentStepIndex < stepIndex) { return "uncompleted"; } } return { stepsLabels, setStatus }; });