프론트엔드 변경

This commit is contained in:
jaehwang committed 2026-09-15 17:00:17 +09:00
1 parent c6c84a10ff
commit ffaa512aee
7 files changed
+103 -12

No files matched your search

+9 -1
View File
@@ -6,6 +6,8 @@ import { useRouter } from "next/navigation";
import { apiFetch } from "@/lib/api";
import { GATE_META, parseGoodsId, type PlayreelJob } from "@/lib/playreel";
import { AutoApprovePanel } from "@/components/auto-approve";
import { useRequireLogin } from "@/components/auth-gate";
import { useMe } from "@/lib/auth";
const STATUS_LABEL: Record<string, string> = {
queued: "대기 중", running: "만드는 중", awaiting_review: "검수 대기", failed: "실패", done: "완료",
@@ -20,6 +22,8 @@ function statusTone(s: string) {
export default function PlayreelStartPage() {
const router = useRouter();
const requireLogin = useRequireLogin();
const { me } = useMe();
const [url, setUrl] = useState("");
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
@@ -27,13 +31,17 @@ export default function PlayreelStartPage() {
// 독립 서비스가 되면서 ADO2 홈의 "최근 작업"을 잃는다. 여기서 대신 보여준다.
const [recent, setRecent] = useState<PlayreelJob[]>([]);
useEffect(() => {
// 잡 목록은 로그인해야 볼 수 있다. 로그인 전에는 부르지 않는다
if (!me) return;
apiFetch<PlayreelJob[]>("/api/playreel/jobs")
.then((j) => setRecent(j.slice(0, 6)))
.catch(() => setRecent([]));
}, []);
}, [me]);
const submit = async () => {
if (!goodsId) return;
// 여기서 처음으로 로그인이 필요해진다
if (!requireLogin()) return;
setBusy(true);
setError(null);
try {