bravio init project

This commit is contained in:
María
2025-10-15 09:41:47 +02:00
commit d6859c386f
74 changed files with 15820 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<template>
<div class="flex flex-col justify-center items-start space-y-4">
<h1 class="text-3xl font-bold">
{{ data.title }}
</h1>
<p class="text-sm" v-html="feedbackText"></p>
<button-CTA
color="accent"
class="ml-auto"
@click="$emit('next')"
>
{{ data.button }}
</button-CTA>
</div>
</template>
<script>
export default {
props: {
data: {
type: Object,
default: () => ({})
},
currentIndex: { type: Number, default: 0 },
total: { type: Number, default: 1 }
},
emits: ["next", "previous"],
data() {
return {
feedbackText: ""
}
},
mounted() {
this.generateFeedbackText();
},
methods: {
generateFeedbackText() {
const results = JSON.parse(localStorage.getItem('results'));
if (!results) {
this.feedbackText = "No hay resultados disponibles.";
return;
}
// Buscar el resultado correspondiente al bloque actual buscando en el array results donde algun objeto tenga el mismo sectionId que this.data.sectionId
const blockId = this.data.section.id;
const blockResult = results.find(r => r.sectionId === blockId);
this.feedbackText = blockResult ? blockResult.result : "No hay feedback disponible para este bloque.";
}
}
}
</script>