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 [pdfUrl, setPdfUrl] = useState(""); // Add the S3 URL here

  return (
    <div className="app">
      <div className="editor">
        <Editor setContent={setContent} />
        {/* Add an input to update the PDF URL */}
        <input
          type="text"
          placeholder="Enter S3 PDF URL"
          value={pdfUrl}
          onChange={(e) => setPdfUrl(e.target.value)}
        />
      </div>
      <div className="pdf-viewer">
        <PDFViewer url={pdfUrl} />
      </div>
    </div>
  );
};

export default App;
