Fix type errors in BudgetContext

Addresses type errors related to category budgets in BudgetContext and Index page. Specifically, ensures correct type assignment for category budget updates.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 10:54:24 +00:00
parent 53096ae26e
commit bbf0f75b66
4 changed files with 35 additions and 65 deletions

View File

@@ -2,6 +2,7 @@
import React from 'react';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import BudgetTabContent from './BudgetTabContent';
import { BudgetPeriod } from '@/contexts/BudgetContext';
interface BudgetData {
targetAmount: number;
@@ -9,12 +10,6 @@ interface BudgetData {
remainingAmount: number;
}
interface CategoryBudget {
식비: number;
생활비: number;
교통비: number;
}
interface BudgetProgressCardProps {
budgetData: {
daily: BudgetData;
@@ -25,7 +20,7 @@ interface BudgetProgressCardProps {
setSelectedTab: (value: string) => void;
formatCurrency: (amount: number) => string;
calculatePercentage: (spent: number, target: number) => number;
onSaveBudget: (type: 'daily' | 'weekly' | 'monthly', amount: number, categoryBudgets?: CategoryBudget) => void;
onSaveBudget: (type: BudgetPeriod, amount: number, newCategoryBudgets?: Record<string, number>) => void;
}
const BudgetProgressCard: React.FC<BudgetProgressCardProps> = ({