diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index ca0ad7a..30948ac 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -1,12 +1,15 @@ -import React from 'react'; +import React, { useState } from 'react'; import NavBar from '@/components/NavBar'; import BudgetCard from '@/components/BudgetCard'; import TransactionCard, { Transaction } from '@/components/TransactionCard'; import AddTransactionButton from '@/components/AddTransactionButton'; import { Wallet, TrendingUp, Bell } from 'lucide-react'; +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; const Index = () => { + const [selectedTab, setSelectedTab] = useState("daily"); + // Sample data - in a real app, this would come from a data source const transactions: Transaction[] = [ { @@ -35,6 +38,33 @@ const Index = () => { }, ]; + // 예산 데이터 - 실제 앱에서는 백엔드에서 가져와야 함 + const budgetData = { + daily: { + targetAmount: 30000, + spentAmount: 15000, + remainingAmount: 15000, + }, + weekly: { + targetAmount: 200000, + spentAmount: 120000, + remainingAmount: 80000, + }, + monthly: { + targetAmount: 1200000, + spentAmount: 750000, + remainingAmount: 450000, + } + }; + + const formatCurrency = (amount: number) => { + return new Intl.NumberFormat('ko-KR', { + style: 'currency', + currency: 'KRW', + maximumFractionDigits: 0 + }).format(amount); + }; + return (
- ₩2,580,000 -
-- 지난 달보다 12% 증가 -
+