import FormLayout, { Flex, FormField, Input, Textarea, FormLabel, ButtonBlack } from "@components/StyledElements/Form/Form"; import { FormMessage } from "@radix-ui/react-form"; import * as Form from '@radix-ui/react-form'; import React, { useState } from "react"; import BarLoader from "react-spinners/BarLoader"; function NewChapterModal({ submitChapter, closeModal, course }: any) { const [chapterName, setChapterName] = useState(""); const [chapterDescription, setChapterDescription] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); const handleChapterNameChange = (e: any) => { setChapterName(e.target.value); }; const handleChapterDescriptionChange = (e: any) => { setChapterDescription(e.target.value); }; const handleSubmit = async (e: any) => { e.preventDefault(); setIsSubmitting(true); const chapter_object = { name: chapterName, description: chapterDescription, thumbnail_image: "", course_id: course.id, org_id: course.org_id }; await submitChapter(chapter_object); setIsSubmitting(false); }; return ( Chapter name Please provide a chapter name Chapter description Please provide a chapter description