ایجاد سامانه جدید حضور غیاب
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="p-5 rounded-2xl bg-white dark:bg-stone-900 border border-stone-200 dark:border-stone-800 shadow-sm relative overflow-hidden group hover:border-primary-500/40 transition">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="space-y-1">
|
||||
<div class="text-xs font-medium text-stone-500 dark:text-stone-400">{{ title }}</div>
|
||||
<div class="text-2xl sm:text-3xl font-black text-stone-900 dark:text-white flex items-baseline gap-1.5">
|
||||
<span>{{ value }}</span>
|
||||
<span v-if="unit" class="text-xs font-normal text-stone-400">{{ unit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="w-12 h-12 rounded-2xl flex items-center justify-center transition duration-200"
|
||||
:class="iconBgClass"
|
||||
>
|
||||
<UIcon :name="icon" class="w-6 h-6" :class="iconColorClass" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="subText" class="mt-3 pt-3 border-t border-stone-100 dark:border-stone-800/80 text-xs flex items-center justify-between text-stone-500 dark:text-stone-400">
|
||||
<span>{{ subText }}</span>
|
||||
<span v-if="trend" :class="trendClass" class="font-bold font-mono">{{ trend }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
title: string
|
||||
value: string | number
|
||||
unit?: string
|
||||
icon?: string
|
||||
color?: 'primary' | 'emerald' | 'amber' | 'rose' | 'blue'
|
||||
subText?: string
|
||||
trend?: string
|
||||
isPositive?: boolean
|
||||
}>(), {
|
||||
icon: 'i-lucide-activity',
|
||||
color: 'primary',
|
||||
unit: '',
|
||||
subText: '',
|
||||
trend: '',
|
||||
isPositive: true
|
||||
})
|
||||
|
||||
const iconBgClass = computed(() => {
|
||||
switch (props.color) {
|
||||
case 'emerald': return 'bg-emerald-50 dark:bg-emerald-950/60'
|
||||
case 'amber': return 'bg-amber-50 dark:bg-amber-950/60'
|
||||
case 'rose': return 'bg-rose-50 dark:bg-rose-950/60'
|
||||
case 'blue': return 'bg-blue-50 dark:bg-blue-950/60'
|
||||
default: return 'bg-primary-50 dark:bg-primary-950/60'
|
||||
}
|
||||
})
|
||||
|
||||
const iconColorClass = computed(() => {
|
||||
switch (props.color) {
|
||||
case 'emerald': return 'text-emerald-600 dark:text-emerald-400'
|
||||
case 'amber': return 'text-amber-600 dark:text-amber-400'
|
||||
case 'rose': return 'text-rose-600 dark:text-rose-400'
|
||||
case 'blue': return 'text-blue-600 dark:text-blue-400'
|
||||
default: return 'text-primary-600 dark:text-primary-400'
|
||||
}
|
||||
})
|
||||
|
||||
const trendClass = computed(() => {
|
||||
return props.isPositive ? 'text-emerald-600 dark:text-emerald-400' : 'text-rose-600 dark:text-rose-400'
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user