mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-22 14:56:31 +00:00
b77c9be36f
* bump prettier/eslint-plugin * bump nuxt pwa * use typed imports * set vue version to fix layout errors * disable import
28 lines
742 B
Vue
28 lines
742 B
Vue
<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">
|
|
import type { StatsFormat } from "./types";
|
|
|
|
type Props = {
|
|
title: string;
|
|
value: number;
|
|
subtitle?: string;
|
|
type?: StatsFormat;
|
|
};
|
|
|
|
withDefaults(defineProps<Props>(), {
|
|
type: "number",
|
|
subtitle: undefined,
|
|
});
|
|
</script>
|