add frontend
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user