'use client'; import { useState, useEffect } from 'react'; import Link from 'next/link'; export default function Home() { const [loggedIn, setLoggedIn] = useState(false); const [password, setPassword] = useState(''); useEffect(() => { if (localStorage.getItem('auth')) setLoggedIn(true); }, []); const handleLogin = async () => { const response = await fetch('/api/auth', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ password }), }); if (response.ok) { const auth = btoa(`admin:${password}`); localStorage.setItem('auth', auth); setLoggedIn(true); } else { alert('Wrong password'); } }; if (!loggedIn) { return (

Login to Mail S3 Admin

setPassword(e.target.value)} className="border border-gray-300 p-4 mb-6 w-full rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter password" />
); } return (

Mail S3 Admin

Go to Domains
); }