// [TSM.ID].[11031972] — All Rights Reserved. Proprietary & Confidential. "use client"; import { useState, useEffect } from "react"; import { useRouter } from "next/navigation"; export default function DashboardPage() { const router = useRouter(); const [isVerifying, setIsVerifying] = useState(true); const [username, setUsername] = useState(""); const [engineStrategy, setEngineStrategy] = useState("XCU_DIRECTOR"); // States for Join Modal const [showJoinModal, setShowJoinModal] = useState(false); const [roomName, setRoomName] = useState(""); // State for Chronos Smart Scheduler const [showChronosModal, setShowChronosModal] = useState(false); const [roomMode, setRoomMode] = useState<"standard" | "webinar" | "podcast">("standard"); const [chronoDate, setChronoDate] = useState(""); const [chronoName, setChronoName] = useState(""); const [chronoResult, setChronoResult] = useState<{link: string, text: string} | null>(null); const [schedules, setSchedules] = useState<{id: string, title: string, mode: string, date: string, link: string}[]>([]); // State for The Vault const [showVaultModal, setShowVaultModal] = useState(false); const [vaultVideoUrl, setVaultVideoUrl] = useState(null); const [vaultVideoName, setVaultVideoName] = useState(""); // States for Copy Alert const [copySuccess, setCopySuccess] = useState(false); useEffect(() => { (async () => { try { const resp = await fetch("/vc/api/auth/me"); const data = await resp.json(); if (data.error) { // Auth failed - show as guest instead of redirecting (prevents loop) setUsername("Guest"); setIsVerifying(false); } else { setUsername(data.email); // Full email as display name if (data.mediaEngineStrategy) { setEngineStrategy(data.mediaEngineStrategy); } setIsVerifying(false); } } catch { // Network error - show as guest instead of redirecting (prevents loop) setUsername("Guest"); setIsVerifying(false); } })(); }, []); const handleNewMeeting = async () => { // TAHAP NANO: Generate Random Room ID dengan Kriptografi Murni const uuid = crypto.randomUUID().toUpperCase().split('-'); const newRoomId = `JMP-${uuid[1]}-${uuid[2]}`; const inviteLink = typeof window !== 'undefined' ? `${window.location.origin}/vc/room/${newRoomId}` : `/vc/room/${newRoomId}`; // Copy to clipboard try { await navigator.clipboard.writeText(`Join JUMPA.ID Meeting:\n${inviteLink}`); setCopySuccess(true); setTimeout(() => { router.push(`/room/${newRoomId}`); }, 1500); // Tunggu 1.5 detik agar user melihat notif tercopy sebelum dipindah } catch { // Fallback jika clipboard API tidak diizinkan router.push(`/room/${newRoomId}`); } }; const handleJoinSubmit = (e: React.FormEvent) => { e.preventDefault(); if (roomName) { router.push(`/room/${roomName.toUpperCase()}`); } }; if (isVerifying) { return (

Securing Connection...

); } return (
{/* Abstract Background Decorators */}
{/* Top Navbar - Ultra Refined */}
JUMPA MEET XCU-DIRECT-LINK
Authenticated as {username}
{username.substring(0,2).toUpperCase()}
{/* Main Content */}
{/* Left Side: Dynamic Status & Info */}
XCU Engine Status: Ultra Optimal

{new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}

{new Date().toLocaleDateString([], { weekday: 'long', month: 'long', day: 'numeric' })}

Protocol

WebTransport HTTP/3 QUIC (0ms Latency Kernel Bypass)

Encryption

Quantum-Safe AES-GCM 256-bit (E2EE Active)

{/* Right Side: High-Density Action Grid */}
{/* New Meeting - The Big Button */} {/* Join Button */} {/* Chronos Button */} {/* Vault Button */} {/* Tenant Master Button */}
{/* Mobile Bottom Navigation - 100% Mobile Compatible */} {/* Ultra Footer */}

Jumpa.ID Meet • Absolute Zero Engine v2.4

{/* Copy Success Alert */} {copySuccess && (
Invite Link Copied! Joining meeting...
)} {/* Join Modal */} {showJoinModal && (

Join Meeting

Enter meeting ID or personal link name

setRoomName(e.target.value.toUpperCase())} placeholder="Meeting ID (e.g. BOARD-ROOM)" className="w-full bg-[#0a101d] text-white border border-white/10 rounded-xl px-4 py-3.5 mb-6 focus:outline-none focus:border-brand focus:ring-1 focus:ring-brand" autoFocus required />
)} {/* CHRONOS SMART SCHEDULER MODAL */} {showChronosModal && (

Chronos Smart Scheduler (Tenant Center)

setRoomMode('standard')} className={`cursor-pointer p-4 rounded-xl border flex flex-col items-center gap-2 transition-all ${roomMode === 'standard' ? 'bg-blue-600/20 border-blue-500 text-blue-400' : 'bg-[#202c33] border-gray-600 text-gray-400 hover:border-gray-400'}`}> Standard VC
setRoomMode('webinar')} className={`cursor-pointer p-4 rounded-xl border flex flex-col items-center gap-2 transition-all ${roomMode === 'webinar' ? 'bg-pink-600/20 border-pink-500 text-pink-400' : 'bg-[#202c33] border-gray-600 text-gray-400 hover:border-gray-400'}`}> Holo-Stage Webinar
setRoomMode('podcast')} className={`cursor-pointer p-4 rounded-xl border flex flex-col items-center gap-2 transition-all ${roomMode === 'podcast' ? 'bg-amber-600/20 border-amber-500 text-amber-500' : 'bg-[#202c33] border-gray-600 text-gray-400 hover:border-gray-400'}`}> Studio Podcast

Jadwalkan Ruangan (Smart Timeline)

{!chronoResult ? (
setChronoDate(e.target.value)} className="flex-1 bg-[#111b21] text-white px-4 py-2 rounded-lg border border-gray-700 focus:outline-none focus:border-pink-500" /> setChronoName(e.target.value)} className="flex-1 bg-[#111b21] text-white px-4 py-2 rounded-lg border border-gray-700 focus:outline-none focus:border-pink-500" />
) : (
Berhasil Dijadwalkan!
)}

3D TIMELINE SCHEDULES

{schedules.length === 0 ? (
Belum ada ruangan yang dijadwalkan.
) : ( schedules.map((sch) => (
{sch.mode} {sch.title}
{new Date(sch.date).toLocaleString('id-ID')}
)) )}
)} {/* THE VAULT (RECORDINGS) MODAL */} {showVaultModal && (

The Vault (Quantum Recordings)

Secure Local Player

Pilih file rekaman hasil Quantum Record (.webm / .mp4) dari perangkat Anda. Video diputar 100% lokal tanpa diunggah ke internet.

{ const file = e.target.files?.[0]; if (file) { if (vaultVideoUrl) URL.revokeObjectURL(vaultVideoUrl); const url = URL.createObjectURL(file); setVaultVideoUrl(url); setVaultVideoName(file.name); } }} />
{vaultVideoUrl && (
📄 {vaultVideoName}
)}
)}
); }