feat(ui): add loading indicator and error handling

This commit is contained in:
2026-08-05 08:29:08 +02:00
parent a63682ced0
commit a0387126de
4 changed files with 22 additions and 15 deletions
@@ -5,6 +5,7 @@ import { onMounted } from 'vue';
import Price from '../components/Price.vue';
import useDashboardViewModel from '../viewmodels/DashboardViewModel';
import Error from '@/components/Error.vue';
import Loading from '@/components/Loading.vue';
const model = useDashboardViewModel();
@@ -17,6 +18,7 @@ onMounted(() => {
<h1 class="mb-4 text-3xl font-black text-primary">
{{ t('dashboard.title') }}
</h1>
<div v-if="model.isLoading"></div>
<div class="mb-4 flex flex-col gap-2" v-if="model.dashboardData.value">
<h2 class="text-2xl font-black text-primary">
{{ t('dashboard.electricity') }}
@@ -135,4 +137,5 @@ onMounted(() => {
</div>
</div>
<Error :message="model.error.value" v-if="model.error.value" />
<Loading v-if="model.isLoading.value" />
</template>