feat: Add Zustand for state management and enhance modal handling
- Integrated Zustand for improved state management across components. - Updated modal components to handle visibility based on active tabs, ensuring better user experience. - Refactored various components to utilize the new tab store for managing active tab states. - Enhanced number formatting utility to streamline number and currency display across the application. Made-with: Cursor
This commit is contained in:
@@ -6,6 +6,7 @@ import { AggregationWidgetConfig, AggregationItem, AggregationResult, Aggregatio
|
||||
import { Calculator, TrendingUp, Hash, ArrowUp, ArrowDown, Loader2 } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useScreenMultiLang } from "@/contexts/ScreenMultiLangContext";
|
||||
import { formatNumber } from "@/lib/formatting";
|
||||
import { apiClient } from "@/lib/api/client";
|
||||
import { v2EventBus, V2_EVENTS, V2ErrorBoundary } from "@/lib/v2-core";
|
||||
|
||||
@@ -566,11 +567,11 @@ export function AggregationWidgetComponent({
|
||||
let formattedValue = value.toFixed(item.decimalPlaces ?? 0);
|
||||
|
||||
if (item.format === "currency") {
|
||||
formattedValue = new Intl.NumberFormat("ko-KR").format(value);
|
||||
formattedValue = formatNumber(value);
|
||||
} else if (item.format === "percent") {
|
||||
formattedValue = `${(value * 100).toFixed(item.decimalPlaces ?? 1)}%`;
|
||||
} else if (item.format === "number") {
|
||||
formattedValue = new Intl.NumberFormat("ko-KR").format(value);
|
||||
formattedValue = formatNumber(value);
|
||||
}
|
||||
|
||||
if (item.prefix) {
|
||||
|
||||
Reference in New Issue
Block a user