import React, { ChangeEvent } from "react"; interface Props { value: string; onChange: (value: string) => void; placeholder?: string; label?: string; onlyAlphaNumeric?: boolean; subLabel?: string; } export const TextInput: React.FC = ({ value, onChange, placeholder, subLabel, onlyAlphaNumeric = true, label, }) => { const handleInputChange = (event: ChangeEvent) => { const newValue = event.target.value; // Only allow numbers or strings if (onlyAlphaNumeric && /^[0-9a-zA-Z]*$/.test(newValue)) { return onChange(newValue); } onChange(newValue); }; return (
{/* {subLabel &&

{subLabel}

} */}
); };