Refactor: Extract CategoryBudgetInputs

Refactors BudgetTabContent.tsx by extracting the category budget functionality into a separate component. This improves code modularity and maintainability.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 04:06:28 +00:00
parent 834517e96f
commit 315f2e3917
3 changed files with 94 additions and 78 deletions

View File

@@ -0,0 +1,52 @@
import React from 'react';
import { Input } from '@/components/ui/input';
interface CategoryBudget {
식비: number;
생활비: number;
교통비: number;
}
interface CategoryBudgetInputsProps {
categoryBudgets: CategoryBudget;
handleCategoryInputChange: (value: string, category: keyof CategoryBudget) => void;
}
const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
categoryBudgets,
handleCategoryInputChange
}) => {
return (
<div className="space-y-2">
<div className="flex items-center justify-between">
<label className="text-sm text-gray-600"></label>
<Input
value={categoryBudgets..toString()}
onChange={e => handleCategoryInputChange(e.target.value, '식비')}
className="neuro-pressed max-w-[150px]"
/>
</div>
<div className="flex items-center justify-between">
<label className="text-sm text-gray-600"></label>
<Input
value={categoryBudgets..toString()}
onChange={e => handleCategoryInputChange(e.target.value, '생활비')}
className="neuro-pressed max-w-[150px]"
/>
</div>
<div className="flex items-center justify-between">
<label className="text-sm text-gray-600"></label>
<Input
value={categoryBudgets..toString()}
onChange={e => handleCategoryInputChange(e.target.value, '교통비')}
className="neuro-pressed max-w-[150px]"
/>
</div>
</div>
);
};
export default CategoryBudgetInputs;