import { LetterFormProvider } from "@web/src/components/models/post/editor/context/LetterEditorContext";
import { LetterBasicForm } from "@web/src/components/models/post/editor/form/LetterBasicForm";
import WriteHeader from "../write/WriteHeader";
import { useSearchParams } from "react-router-dom";

export default function LetterEditorPage() {
	const [searchParams] = useSearchParams();
	const receiverId = searchParams.get("receiverId");
	const termId = searchParams.get("termId");

	return (
		<div className="shadow-elegant border-2 border-white rounded-xl bg-slate-200">
			<WriteHeader></WriteHeader>
			<LetterFormProvider receiverId={receiverId} termId={termId}>
				<LetterBasicForm />
			</LetterFormProvider>
		</div>
	);
}
