refactor(dashboard): extract KpiRow with KpiCard components
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
be6d557622
commit
4e9de2d3c3
1 changed files with 54 additions and 0 deletions
54
web/src/components/dashboard/KpiRow.vue
Normal file
54
web/src/components/dashboard/KpiRow.vue
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<script setup lang="ts">
|
||||
import KpiCard from '@/components/dashboard/KpiCard.vue'
|
||||
import { formatDuration } from '@/lib/utils'
|
||||
import type { KpiSummary } from '@/types'
|
||||
|
||||
defineProps<{
|
||||
summary: KpiSummary | null
|
||||
loading: boolean
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-6 gap-4">
|
||||
<KpiCard
|
||||
label="Total Hours"
|
||||
:value="summary ? formatDuration(summary.total_hours) : '—'"
|
||||
icon="clock"
|
||||
:loading="loading"
|
||||
:hero="true"
|
||||
/>
|
||||
<KpiCard
|
||||
label="Working Days"
|
||||
:value="summary?.working_days ?? '—'"
|
||||
icon="calendar"
|
||||
:loading="loading"
|
||||
/>
|
||||
<KpiCard
|
||||
label="Projects"
|
||||
:value="summary?.total_projects ?? '—'"
|
||||
icon="folder"
|
||||
:loading="loading"
|
||||
to="/projects"
|
||||
/>
|
||||
<KpiCard
|
||||
label="Avg / Day"
|
||||
:value="summary ? formatDuration(summary.avg_hours_per_day) : '—'"
|
||||
icon="trending-up"
|
||||
:loading="loading"
|
||||
/>
|
||||
<KpiCard
|
||||
label="Top Project"
|
||||
:value="summary?.top_project ?? '—'"
|
||||
icon="star"
|
||||
:loading="loading"
|
||||
to="/projects"
|
||||
/>
|
||||
<KpiCard
|
||||
label="Commits"
|
||||
:value="summary?.total_commits ?? '—'"
|
||||
icon="git"
|
||||
:loading="loading"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
Loading…
Add table
Reference in a new issue