import React, { useState } from "react";
import Editor from "./components/Editor";
import PDFViewer from "./components/PDFViewer";
import "./App.css";

const App = () => {
  const [content, setContent] = useState("");
  const [pdf, setPdf] = useState(null);

  // Assume convertToPDF is a function that converts content to a PDF Blob
  const convertToPDF = async () => {
    // Conversion logic here...
    setPdf(await someConversionFunction(content));
  };

  return (
    <div className="app">
      <div className="editor">
        <Editor setContent={setContent} />
        <button onClick={convertToPDF}>Convert to PDF</button>
      </div>
      <div className="pdf-viewer">
        <PDFViewer pdf={pdf} />
      </div>
    </div>
  );
};

export default App;
