diff --git a/src/components/AddTransactionButton.tsx b/src/components/AddTransactionButton.tsx index ebe69d1..6c6681a 100644 --- a/src/components/AddTransactionButton.tsx +++ b/src/components/AddTransactionButton.tsx @@ -1,47 +1,142 @@ import React, { useState } from 'react'; -import { MinusIcon, X } from 'lucide-react'; +import { PlusIcon, MinusIcon, X } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useNavigate } from 'react-router-dom'; +import { Dialog, DialogContent, DialogHeader, DialogTitle } from './ui/dialog'; +import { Form, FormField, FormItem, FormLabel, FormControl } from './ui/form'; +import { Input } from './ui/input'; +import { Button } from './ui/button'; +import { useForm } from 'react-hook-form'; + +interface ExpenseFormValues { + title: string; + amount: string; + category: string; +} const AddTransactionButton = () => { const [isOpen, setIsOpen] = useState(false); + const [showExpenseDialog, setShowExpenseDialog] = useState(false); const navigate = useNavigate(); + const form = useForm({ + defaultValues: { + title: '', + amount: '', + category: '식비', + } + }); + const handleAddExpense = () => { - // 여기에 지출 추가 로직을 구현할 수 있습니다 setIsOpen(false); - // 향후 트랜잭션 추가 페이지로 이동할 수 있습니다 - // navigate('/add-transaction', { state: { type: 'expense' } }); + setShowExpenseDialog(true); + }; + + const onSubmit = (data: ExpenseFormValues) => { + console.log('Expense data:', data); + setShowExpenseDialog(false); + // 여기에서 실제 데이터 처리 로직을 구현할 수 있습니다 }; return ( -
- {isOpen && ( -
- -
- )} - - +
)} - onClick={() => setIsOpen(!isOpen)} - aria-label={isOpen ? "닫기" : "거래 추가"} - > - {isOpen ? : } - - + + + + + + + + 지출 추가 + + +
+ + ( + + 제목 + + + + + )} + /> + + ( + + 금액 + + + + + )} + /> + + ( + + 카테고리 + + + + + )} + /> + +
+ + +
+ + +
+
+ ); };