safavi works

This commit is contained in:
2026-06-23 09:18:41 +02:00
parent 0e16e7c186
commit 1cf4c9675b
41 changed files with 965 additions and 522 deletions
@@ -1,10 +1,11 @@
<script setup lang="ts">
import { computed } from 'vue'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import BoursecuAssetsSummary from '../../components/BoursecuAssetsSummary.vue'
import { usePriceWithoutType } from '@/utils/usePrice'
import { useWalletAssets } from '@/composables/useWalletAssets'
import type { WalletMetalTotal } from '@/models/walletAssets'
import { buildBoursecuHomeAssetRows, resolveSummaryMetalWeight } from '@/utils/productAssets'
import { resolveSummaryMetalWeight } from '@/utils/productAssets'
import { useHomePageContext } from '../../composables/useHomePage'
const emit = defineEmits<{
@@ -29,9 +30,6 @@ type MetricItem = {
label: string
value: string
metal?: WalletMetalTotal
modalText?: string
modalTitle?: string
modalContent?: string
showInfo?: boolean
onInfo?: 'gold' | 'rial'
}
@@ -47,23 +45,6 @@ const metrics = computed<MetricItem[]>(() => {
})
}
if (isBoursecuLayout.value) {
buildBoursecuHomeAssetRows(assetsSummary.value).forEach((row) => {
items.push({
id: row.id,
label: row.label,
value: row.value,
metal: row.metal,
modalText: row.modalText,
modalTitle: row.modalTitle,
modalContent: row.modalContent,
showInfo: row.info !== 'none',
onInfo: row.info === 'rial' ? 'rial' : 'gold',
})
})
return items
}
if (meta.value?.single_metal && metalTotals.value[0]) {
const metal = metalTotals.value[0]
items.push({
@@ -108,13 +89,19 @@ function handleInfo(metric: MetricItem) {
return
}
if (metric.metal) {
emit('openGoldModal', metric.metal, metric.modalText, metric.modalTitle, metric.modalContent)
emit('openGoldModal', metric.metal)
}
}
</script>
<template>
<div class="dhome-metrics">
<BoursecuAssetsSummary
v-if="isBoursecuLayout"
variant="desktop"
icon-color="tertiary"
/>
<div v-else class="dhome-metrics">
<article v-for="metric in metrics" :key="metric.id" class="dhome-metric-tile">
<div class="dhome-metric-tile__head">
<span class="dhome-metric-tile__label">{{ metric.label }}</span>