fix: share the dashboard assistant and count leads from data

The hero ask box now uses the same confirm-before-create path as the assistant, count questions use real filters, and lead mobile, Jalali follow-ups, and rial labels stay consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-13 14:45:29 +03:30
co-authored by Cursor
parent 0e420a443f
commit 5f4cc47c41
14 changed files with 1463 additions and 44 deletions
+1
View File
@@ -8,6 +8,7 @@ export const CURRENCY_OPTIONS = [
] as const;
export function currencySuffix(code: string): string {
if (code === 'IRT') return 'ریال';
return CURRENCY_OPTIONS.find((c) => c.code === code)?.suffix ?? code;
}
+5 -5
View File
@@ -1,3 +1,4 @@
import { currencySuffix } from '@/lib/money';
import { matchesSearch } from '@/lib/search';
export type PipelineAccent = 'green' | 'orange' | 'purple' | 'blue' | 'rose' | 'slate';
@@ -118,8 +119,8 @@ export const PIPELINE_ACCENT: Record<
const ACCENT_CYCLE: PipelineAccent[] = ['green', 'orange', 'purple'];
/** خروجی: ۲۵۰,۰۰۰,۰۰۰ تومان */
export function formatCurrency(amount: number, unit = 'تومان'): string {
/** خروجی: ۲۵۰,۰۰۰,۰۰۰ ریال */
export function formatCurrency(amount: number, unit = 'ریال'): string {
try {
return `${new Intl.NumberFormat('fa-IR').format(amount)} ${unit}`;
} catch {
@@ -129,7 +130,7 @@ export function formatCurrency(amount: number, unit = 'تومان'): string {
export function formatCurrencyParts(
amount: number,
unit = 'تومان',
unit = 'ریال',
): { number: string; unit: string } {
try {
return {
@@ -155,8 +156,7 @@ export function initialsFromTitle(title: string): string {
}
export function currencyUnitLabel(currency: string): string {
if (currency === 'IRR' || currency === 'IRT') return 'تومان';
return currency;
return currencySuffix(currency || 'IRR');
}
/** نگاشت برد API به مدل UI مسیر فروش */