import React from 'react'; import { FormControl, FormHelperText, FormLabel, Text, Input, InputGroup, Stack, Box, Button, Textarea, Flex, } from '@chakra-ui/react'; import { UseFormReturn } from 'react-hook-form'; export type InputFields = { title: string; description: string; }; export type LessonFormPropsType = { onSubmit: () => Promise; buttonLabel: string; isLoading: boolean; reactHookForm: UseFormReturn; }; const LessonForm: React.FC = ({ onSubmit, buttonLabel, isLoading, reactHookForm }) => { const { control, register, watch, formState: { errors, isDirty }, } = reactHookForm; return (
Title e.g Variables in Javascript {errors.title?.message} Description