SRP split: HealthDashboardView (presentational, props-based) + HealthDashboard (smart wrapper, useFetch). Enables 4 Storybook stories per state + unit testability per branch. Existing testids preserved, Playwright tests still pass. Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
14 lines
547 B
Vue
14 lines
547 B
Vue
<script setup lang="ts">
|
|
import HealthDashboardView, { type HealthInfo } from './HealthDashboardView.vue'
|
|
|
|
// Wrapper: handles data fetching, delegates rendering to HealthDashboardView.
|
|
// Separation of concerns (SRP):
|
|
// - HealthDashboard (this) = data layer (useFetch lifecycle)
|
|
// - HealthDashboardView = presentation layer (testable in Storybook + e2e)
|
|
const { data, pending, error } = await useFetch<HealthInfo>('/api/healthz')
|
|
</script>
|
|
|
|
<template>
|
|
<HealthDashboardView :data="data" :pending="pending" :error="error" />
|
|
</template>
|