diff --git a/components/informations/ProjectProgress.vue b/components/informations/ProjectProgress.vue index ec3f0a1..1ac3d1f 100644 --- a/components/informations/ProjectProgress.vue +++ b/components/informations/ProjectProgress.vue @@ -12,28 +12,28 @@
- {{ progress[i].length / 5 }}% + {{ p.progress / 5 }}%
- {{ progress[i].length }} {{ $t("tiles") }} + {{ p.progress }} {{ $t("tiles") }}
-
+
const progress = useProgressStore(); -const currentMouseOver = ref(); +const currentMouseOver = ref(); -const tileProgress = ref({ - finished: { - classes: "bg-success text-bg-success", - styles: "border-radius: 50rem 0 0 50rem;", - text: "finished", - }, - inProgress: { - classes: "bg-primary text-bg-primary", - styles: "", - text: "in-progress", - }, - reserved: { - classes: "bg-danger text-bg-danger", - styles: "", - text: "reserved", - }, - availableInStock: { - classes: "bg-warning text-bg-warning", - styles: "border-radius: 0 50rem 50rem 0;", - text: "available-in-stock", - }, - availableOutOfStock: { - classes: "bg-info text-bg-info", - styles: "border-radius: 0 50rem 50rem 0;", - text: "available-out-of-stock", - }, -}); +const tileProgress = computed(() => + [ + { + classes: "bg-success text-bg-success", + styles: "border-radius: 50rem 0 0 50rem;", + text: "finished", + progress: progress.finished.length, + }, + { + classes: "bg-primary text-bg-primary", + styles: "", + text: "in-progress", + progress: progress.inProgress.length, + }, + { + classes: "bg-danger text-bg-danger", + styles: "", + text: "reserved", + progress: progress.reserved.length, + }, + { + classes: "bg-warning text-bg-warning", + styles: "border-radius: 0 50rem 50rem 0;", + text: "available-in-stock", + progress: progress.availableInStock.length, + }, + { + classes: "bg-info text-bg-info", + styles: "border-radius: 0 50rem 50rem 0;", + text: "available-out-of-stock", + progress: progress.availableOutOfStock.length, + }, + ].filter((p) => p.progress > 0), +);