7.8 일반 게시판 공용 폼/라우트 템플릿 생성 o

This commit is contained in:
koreacomp5
2025-10-09 17:11:50 +09:00
parent 05ce9f65ea
commit 416071d718
5 changed files with 79 additions and 3 deletions

View File

@@ -4,10 +4,10 @@ import { useRouter } from "next/navigation";
import { useToast } from "@/app/components/ui/ToastProvider";
import { UploadButton } from "@/app/components/UploadButton";
export default function NewPostPage() {
export default function NewPostPage({ searchParams }: { searchParams?: { boardId?: string } }) {
const router = useRouter();
const { show } = useToast();
const [form, setForm] = useState({ boardId: "", title: "", content: "" });
const [form, setForm] = useState({ boardId: searchParams?.boardId ?? "", title: "", content: "" });
const [loading, setLoading] = useState(false);
async function submit() {
try {