7.5 추천/신고, 조회수 카운트 o

This commit is contained in:
koreacomp5
2025-10-09 17:05:19 +09:00
parent 60d7972762
commit 6d37881dd7
7 changed files with 97 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import { useParams, useRouter } from "next/navigation";
import { useToast } from "@/app/components/ui/ToastProvider";
import { UploadButton } from "@/app/components/UploadButton";
export default function EditPostPage() {
const params = useParams<{ id: string }>();
@@ -43,6 +44,7 @@ export default function EditPostPage() {
<h1> </h1>
<input placeholder="제목" value={form.title} onChange={(e) => setForm({ ...form, title: e.target.value })} />
<textarea placeholder="내용" value={form.content} onChange={(e) => setForm({ ...form, content: e.target.value })} rows={10} />
<UploadButton onUploaded={(url) => setForm((f) => (!f ? f : { ...f, content: `${f.content}\n![image](${url})` }))} />
<button disabled={loading} onClick={submit}>{loading ? "저장 중..." : "저장"}</button>
</div>
);