Fix budget total calculation

Ensure budget total calculation aligns with weekly or monthly budget settings.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 11:13:26 +00:00
parent ef239e6126
commit 5f125de8d7
2 changed files with 9 additions and 1 deletions

View File

@@ -47,6 +47,13 @@ const BudgetProgressCard: React.FC<BudgetProgressCardProps> = ({
return () => clearTimeout(timeoutId);
}, [budgetData]);
// 컴포넌트 마운트 시 월간 탭을 기본으로 설정
useEffect(() => {
if (selectedTab !== 'monthly') {
setSelectedTab('monthly');
}
}, []);
// budgetDataUpdated 이벤트 감지
useEffect(() => {
const handleBudgetDataUpdated = () => {
@@ -76,7 +83,7 @@ const BudgetProgressCard: React.FC<BudgetProgressCardProps> = ({
return (
<div className="neuro-card mb-6 overflow-hidden w-full">
<Tabs defaultValue="daily" value={selectedTab} onValueChange={handleTabChange} className="w-full">
<Tabs defaultValue="monthly" value={selectedTab} onValueChange={handleTabChange} className="w-full">
<TabsList className="grid grid-cols-3 mb-4 bg-transparent">
<TabsTrigger
value="daily"