import React from 'react'; import { FormControl, FormHelperText, FormLabel, Text, Input, InputGroup, Stack, Box, Button, Textarea, Flex, Divider, } from '@chakra-ui/react'; import { Controller, UseFormReturn } from 'react-hook-form'; import VideoUploader from '@educt/components/VideoUploader'; import FilesUploader from '@educt/components/FilesUploader'; import { FileSupportedFormatsEnum, VideoSupportedFormatsEnum } from '@educt/enums'; export type InputFields = { title: string; description: string; duration: string; video: File; materials?: File[] | undefined; }; export type LessonFormPropsType = { onSubmit: () => Promise; buttonLabel: string; isLoading: boolean; reactHookForm: UseFormReturn; }; const LessonForm: React.FC = ({ onSubmit, buttonLabel, isLoading, reactHookForm }) => { const { control, register, formState: { errors, isDirty }, } = reactHookForm; return (
Title e.g Introduction {errors.title?.message} Description