import { m } from '@/utils/metalLabels' import { metalDisplayUnit } from '@/utils/metalWeight' /** برچسب‌های پرتکرار پنل ادمین که «طلا» در متن دارند */ export const metalLabel = { goldBalance: () => m('تراز طلایی'), goldCommission: () => m('کارمزد طلایی'), goldWallet: () => m('کیف پول طلایی'), goldWalletShort: () => m('طلایی'), goldAmount: () => m('مقدار طلا'), goldInventory: () => m('موجودی طلایی'), goldGramPriceCustomer: () => m('قیمت هر گرم طلا برای مشتری (ریال)'), goldGramPriceOriginal: () => m('قیمت هر گرم طلا بدون سود (ریال)'), goldGramPriceOriginalSlash: () => m('/قیمت هر گرم طلا بدون سود (ریال)'), customersGold: () => m('طلای مشتریان'), goldValueInRial: () => m('ارزش طلا به ریال'), goldWalletCharge: () => m('شارژ کیف پول طلایی'), goldWalletBalance: () => m('موجودی طلایی (گرم)'), goldWalletBalanceGram: () => m('موجودی کیف طلا (گرم)'), goldInTransaction: () => m('مقدار طلا طی تراکنش (گرم)'), goldWalletTitle: () => m('کیف پول طلا'), goldPlaceholder: () => m('مقدار طلا'), goldUnit: () => m('طلا'), goldChargeShort: () => m('شارژ طلایی'), manageGoldCash: () => m('مدیریت موجودی ریالی و طلایی'), goldGifts: () => m('هدایای طلا'), goldTradeBuySell: (direction: 1 | 2 | number) => m(`قیمت ${direction === 1 ? 'خرید' : 'فروش'} طلا:`), totalGoldWallet: () => m('مجموع موجودی کیف طلا'), goldWalletTab: () => m('کیف طلا'), } export function walletMetalBalanceTitle(metalId: number, label?: string) { const unit = metalDisplayUnit(metalId) switch (metalId) { case 1: return m(`موجودی کیف طلا (${unit})`) case 2: return m(`موجودی کیف نقره (${unit})`) case 3: return m(`موجودی کیف مس (${unit})`) default: return label ? `موجودی کیف ${label} (${unit})` : metalLabel.goldWalletBalanceGram() } } export function customerWalletMetalBalanceTitle(metalId: number, label?: string) { const unit = metalDisplayUnit(metalId) switch (metalId) { case 1: return m(`موجودی طلایی (${unit})`) case 2: return m(`موجودی نقره (${unit})`) case 3: return m(`موجودی مس (${unit})`) default: return label ? `موجودی ${label} (${unit})` : metalLabel.goldWalletBalance() } } export function totalMetalWalletTitle(metalId: number, label?: string) { const unit = metalDisplayUnit(metalId) switch (metalId) { case 1: return m(`مجموع موجودی کیف طلا`) case 2: return m(`مجموع موجودی کیف نقره`) case 3: return m(`مجموع موجودی کیف مس`) default: return label ? `مجموع موجودی کیف ${label}` : metalLabel.totalGoldWallet() } } export function metalBalanceTitle(metalId: number, label?: string) { switch (metalId) { case 1: return metalLabel.goldBalance() case 2: return m('تراز نقره') case 3: return m('تراز مس') default: return label ? `تراز ${label}` : metalLabel.goldBalance() } } export function metalBalanceTitleWithUnit(metalId: number, label?: string) { const unit = metalDisplayUnit(metalId) return `${metalBalanceTitle(metalId, label)} (${unit})` } export function transactionMetalAmountTitle(metalId: number, label?: string) { const unit = metalDisplayUnit(metalId) switch (metalId) { case 1: return m(`مقدار طلا طی تراکنش (${unit})`) case 2: return m(`مقدار نقره طی تراکنش (${unit})`) case 3: return m(`مقدار مس طی تراکنش (${unit})`) default: return label ? `مقدار ${label} طی تراکنش (${unit})` : metalLabel.goldInTransaction() } } export function dealPriceAtTransactionTitle(metalId: number, label?: string) { switch (metalId) { case 1: return m('قیمت زمان معامله طلا (ریال)') case 2: return m('قیمت زمان معامله نقره (ریال)') case 3: return m('قیمت زمان معامله مس (ریال)') default: return label ? `قیمت زمان معامله ${label} (ریال)` : 'قیمت زمان معامله (ریال)' } } export function metalCommissionTitle(metalId: number, label?: string) { switch (metalId) { case 1: return metalLabel.goldCommission() case 2: return m('کارمزد نقره') case 3: return m('کارمزد مس') default: return label ? `کارمزد ${label}` : metalLabel.goldCommission() } }