Modified | Change Account Settings

This commit is contained in:
sageTheDM 2024-10-03 14:54:59 +02:00
parent 7c77e43be8
commit d12c850df0
2 changed files with 9 additions and 10 deletions

View file

@ -5,9 +5,10 @@ interface TextSettingProps {
value: string; // The current text value
setValue: (newText: string) => void; // The method to update the state
type: 'text' | 'email' | 'password'; // The type of input field
placeholder?: string; // Optional placeholder text
}
const TextSetting: React.FC<TextSettingProps> = ({ label, value, setValue, type }) => {
const TextSetting: React.FC<TextSettingProps> = ({ label, value, setValue, type, placeholder }) => {
const handleTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const newText = e.target.value; // Get the new value from the input
setValue(newText); // Update the state in the parent component
@ -20,6 +21,7 @@ const TextSetting: React.FC<TextSettingProps> = ({ label, value, setValue, type
type={type} // Use the type prop for the input
value={value} // Set the current value
onChange={handleTextChange} // Handle input changes
placeholder={placeholder} // Set the placeholder text
/>
</div>
);