import { useState } from "react"; import { CLASSLENS_ICON } from "../lib/icon"; interface InviteGateProps { onSuccess: () => void; correctCode: string; } export function InviteGate({ onSuccess, correctCode }: InviteGateProps) { const [code, setCode] = useState(""); const [error, setError] = useState(""); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (code.trim() === correctCode) { onSuccess(); } else { setError("邀請碼不正確,請再試一次"); } }; return (
請輸入邀請碼以繼續