import React, { FC, useState } from 'react' import styles from './textfield.module.css' type TextFieldTypes = { /** * Label of the TextField */ label: string; /** * Error message or other information */ hint: string; /** * If error */ error?: boolean; /** * Text left in the field */ front?: string; /** * Text right in the field */ back?: string; } export const TextField: FC = ({ label = "Some label", front, hint = "Information", error, back }) => { const [hasFocus, setHasFocus] = useState(false); const onFocus = () => { setHasFocus(true); }; const onBlur = () => { setHasFocus(false); }; let borderColor = 'gray-400'; if(error) { borderColor = 'red-600' } return (
{ label &&

{ label }

}
{ front &&
{ front }
} { back &&
{ back }
}
{ { hint } &&

{ hint }

}
) };