Investigate default value for number inputs

The prompt asks to investigate the current default value (0) for number input fields and consider alternative approaches based on other applications.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 05:41:05 +00:00
parent 74865848f5
commit 50520ed254
4 changed files with 38 additions and 16 deletions

View File

@@ -14,6 +14,7 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
}) => {
// Format number with commas for display
const formatWithCommas = (value: number): string => {
if (value === 0) return '';
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};
@@ -31,7 +32,8 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
<label className="text-sm text-gray-600">{category}</label>
<Input
value={formatWithCommas(categoryBudgets[category] || 0)}
onChange={(e) => handleInput(e, category)}
onChange={(e) => handleInput(e, category)}
placeholder="예산 입력"
className="neuro-pressed max-w-[150px]"
/>
</div>