2022-12-30 01:19:15 +00:00
|
|
|
<template>
|
|
|
|
<div class="stats bg-neutral shadow rounded-md">
|
|
|
|
<div class="stat text-neutral-content text-center space-y-1 p-3">
|
|
|
|
<div class="stat-title">{{ title }}</div>
|
|
|
|
<div class="stat-value text-2xl">
|
|
|
|
<Currency v-if="type === 'currency'" :amount="value" />
|
|
|
|
<template v-if="type === 'number'">{{ value }}</template>
|
|
|
|
</div>
|
|
|
|
<div v-if="subtitle" class="stat-desc">{{ subtitle }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2024-03-01 18:08:14 +00:00
|
|
|
import type { StatsFormat } from "./types";
|
2022-12-30 01:19:15 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
title: string;
|
|
|
|
value: number;
|
|
|
|
subtitle?: string;
|
|
|
|
type?: StatsFormat;
|
|
|
|
};
|
|
|
|
|
|
|
|
withDefaults(defineProps<Props>(), {
|
|
|
|
type: "number",
|
|
|
|
subtitle: undefined,
|
|
|
|
});
|
|
|
|
</script>
|