add nav and footer
This commit is contained in:
42
eduseg/src/components/Form.tsx
Normal file
42
eduseg/src/components/Form.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { useForm } from "react-hook-form";
|
||||
|
||||
interface IFormInput {
|
||||
name: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export function Form() {
|
||||
const { register, handleSubmit } = useForm<IFormInput>();
|
||||
|
||||
const onSubmit = async (data: IFormInput) => {
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="flex flex-col gap-2.5">
|
||||
<label>
|
||||
Nome
|
||||
<Input {...register("name")} />
|
||||
</label>
|
||||
<label>
|
||||
Email
|
||||
<Input {...register("email")} />
|
||||
</label>
|
||||
<button
|
||||
type="submit"
|
||||
className="font-medium bg-green-secondary hover:bg-green-support p-2.5 rounded-lg transition cursor-pointer h-12"
|
||||
>
|
||||
Quero um orçamento
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
export function Input({ ...props }) {
|
||||
return (
|
||||
<input
|
||||
className="border border-gray-300 focus:border-green-secondary focus:ring ring-green-secondary bg-white px-5 rounded-lg w-full outline-none h-12"
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user