forked from M3-Academy/desafio-react-e-typescript
Entrega do Desafio #2
@ -0,0 +1,24 @@
|
||||
import styles from "../../Main.module.scss";
|
||||
import { Field, ErrorMessage } from "formik";
|
||||
|
||||
interface FormContentFieldProps {
|
||||
title: string;
|
||||
name: string;
|
||||
placeholder: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
const FormField = (props: FormContentFieldProps) => {
|
||||
const { title, name, placeholder, type } = props;
|
||||
return (
|
||||
<div className={styles["FormContent__Field"]}>
|
||||
<label>{title}</label>
|
||||
<span className={styles["FormContent__Field__Error"]}>
|
||||
<ErrorMessage name={name} />
|
||||
</span>
|
||||
<Field name={name} type={type} placeholder={placeholder} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { FormField };
|
Loading…
Reference in New Issue
Block a user