import type { NextPage } from "next"; import { useState, useRef } from "react"; import Head from "next/head"; import BookInfoInput from "../components/BookInfoInput"; import DocReceiver from "../components/DocReceiver"; import { bookRequest } from "../lib/fetchers"; import FormatGuideModal from "../components/FormatGuideModal"; import Script from "next/script"; // TODO: Make Title Required // TODO: Have author field in there // TODO: Allow Word File straight w/ images etc upload // TDOO: Add language selection option (Pashto, Arabic, Farsi, Urdu) const Home: NextPage = () => { const mdRef = useRef(null); const [showFormatGuide, setShowFormatGuide] = useState(false); const [submissionStatus, setSubmissionStatus] = useState(""); function handleReceiveText(m: string) { mdRef.current.value = m; } function clearText() { mdRef.current.value = ""; } function handleSubmit(info: { frontmatter: Frontmatter, cover: File | undefined }) { const content = mdRef.current.value as string; if (!content) { alert("Please enter some content for the book"); return; } if (!info.frontmatter.title) { alert("Please enter a title for the book"); return; } setSubmissionStatus(""); bookRequest({ ...info, content, }, { complete: () => setSubmissionStatus("Done"), progress: (p) => setSubmissionStatus(p < 100 ? `Uploading ${p}%...` : "Processing..."), error: () => setSubmissionStatus("Error"), }); } return (
RTL EPUB Maker

RTL EPUB Maker 📚

Easily create EPUB e-book files with proper RTL support

Book Content