import React from 'react' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' interface NumberInputProps { id: string label: string value: number | undefined onChange: (value: number | undefined) => void placeholder?: string description?: string disabled?: boolean className?: string } const NumberInput: React.FC = ({ id, label, value, onChange, placeholder, description, disabled = false, className }) => { const handleChange = (inputValue: string) => { if (inputValue === '') { onChange(undefined) return } const numValue = parseFloat(inputValue) if (!isNaN(numValue)) { onChange(numValue) } } return (
handleChange(e.target.value)} placeholder={placeholder} disabled={disabled} className={className} /> {description && (

{description}

)}
) } export default NumberInput