import React, { useState } from "react"; import Modal from "../Modal"; function NewChapterModal({ submitChapter , closeModal }: any) { const [chapterName, setChapterName] = useState(""); const [chapterDescription, setChapterDescription] = useState(""); const handleChapterNameChange = (e: any) => { setChapterName(e.target.value); }; const handleChapterDescriptionChange = (e: any) => { setChapterDescription(e.target.value); }; const handleSubmit = async (e: any) => { e.preventDefault(); console.log({ chapterName, chapterDescription }); submitChapter({ name : chapterName, description : chapterDescription , elements : [] }); }; return (

Add New Chapter



); } export default NewChapterModal;