55 lines
1.3 KiB
Vue
55 lines
1.3 KiB
Vue
<template>
|
|||
|
|
<div class="flex">
|
||
|
|
<div class="w-full flex md:block justify-between md:justify-unset items-center">
|
||
|
|
<div class="flex items-center gap-2 mx-2">
|
||
|
|
<div class="p-1 h-8 aspect-square rounded-full" :class="bgColor">
|
||
|
|
<BaseIcon icon="vuesax-linear:profile-add" :class="textColor" />
|
||
|
|
</div>
|
||
|
|
<div class="text-xs font-bold">{{ title }}</div>
|
||
|
|
</div>
|
||
|
|
<div class="flex flex-row-reverse gap-1 mt-5 items-center md:w-full pl-2 items-end">
|
||
|
|
<div class="text-xs">{{ unit }}</div>
|
||
|
|
<div class="font-bold text-xl">{{ count }}</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup lang="ts">
|
||
|
|
interface Prop {
|
||
|
|
color: string
|
||
|
|
title: string
|
||
|
|
count?: number
|
||
|
|
unit: 'نفر' | 'گرم'
|
||
|
|
}
|
||
|
|
|
||
|
|
const props = defineProps<Prop>()
|
||
|
|
|
||
|
|
const bgColor = computed(() => {
|
||
|
|
switch (props.color) {
|
||
|
|
case 'fuchsia':
|
||
|
|
return 'bg-fuchsia-100'
|
||
|
|
case 'orange':
|
||
|
|
return 'bg-orange-100'
|
||
|
|
case 'green':
|
||
|
|
return 'bg-green-100'
|
||
|
|
case 'blue':
|
||
|
|
return 'bg-blue-100'
|
||
|
|
}
|
||
|
|
})
|
||
|
|
const textColor = computed(() => {
|
||
|
|
switch (props.color) {
|
||
|
|
case 'fuchsia':
|
||
|
|
return 'text-fuchsia-600'
|
||
|
|
case 'orange':
|
||
|
|
return 'text-orange-600'
|
||
|
|
case 'green':
|
||
|
|
return 'text-green-600'
|
||
|
|
case 'blue':
|
||
|
|
return 'text-blue-600'
|
||
|
|
}
|
||
|
|
})
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped lang="less"></style>
|