add frontend

This commit is contained in:
voltsrage
2026-06-19 17:42:09 +08:00
parent 49973271e5
commit 5f69ce1a95
53 changed files with 6591 additions and 0 deletions
@@ -0,0 +1,28 @@
<script setup>
import { storeToRefs } from 'pinia'
import { useWardStore } from '@/stores/ward'
import { usePolling } from '@/composables/usePolling'
import WardTable from '@/components/ward/WardTable.vue'
import Skeleton from '@/components/ui/Skeleton.vue'
import EmptyState from '@/components/ui/EmptyState.vue'
const wardStore = useWardStore()
const { sortedByRisk, loading, error, criticalCount } = storeToRefs(wardStore)
usePolling(() => wardStore.loadEncounters(), 10_000)
</script>
<template>
<div>
<div class="mb-4 flex items-center justify-between">
<h1 class="text-xl font-bold dark:text-white">Virtual Ward</h1>
<Badge v-if="criticalCount > 0" variant="critical">
{{ criticalCount }} critical
</Badge>
</div>
<Skeleton v-if="loading && sortedByRisk.length === 0" :rows="5" />
<EmptyState v-else-if="sortedByRisk.length === 0" message="No active patients" />
<WardTable v-else :patients="sortedByRisk" />
</div>
</template>