Files

34 lines
754 B
Vue

<script setup lang="ts">
withDefaults(
defineProps<{
label: string
value: string
hint?: string
badge?: string
badgeColor?: 'neutral' | 'danger' | 'success' | 'primary' | 'warning' | 'info'
icon?: string
}>(),
{ badgeColor: 'neutral' },
)
</script>
<template>
<OnyxCard class="stat-card">
<p class="stat-label">
<OnyxIcon v-if="icon" :icon="icon" size="16px" color="primary" />
{{ label }}
</p>
<p class="stat-value">{{ value }}</p>
<OnyxBadge v-if="badge" :color="badgeColor" density="compact">{{ badge }}</OnyxBadge>
<p v-if="hint" class="stat-hint">{{ hint }}</p>
</OnyxCard>
</template>
<style scoped>
.stat-label {
display: flex;
align-items: center;
gap: 0.35rem;
}
</style>