import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants"; import { useRouter } from "next/router"; import dynamic from "next/dynamic"; import React, { useState } from "react"; import { Button } from "@documenso/ui"; import short from "short-uuid"; const stc = require("string-to-color"); const PDFViewer = dynamic(() => import("./pdf-viewer"), { ssr: false, }); export default function PDFEditor(props: any) { const [selectedValue, setSelectedValue] = useState(""); const [fields, setFields] = useState([]); const router = useRouter(); function onPositionChangedHandler(position: any, id: any) { if (!position) return; const newFields = [...fields]; fields.find((e) => e.id == id).position = position; // no instant redraw neccessary, postion information for saving or later rerender is enough // setFields(newFields); } return ( <> ); }