From 2372977876f5c802538a6767dc40748923b8b4c0 Mon Sep 17 00:00:00 2001 From: tamfrr Date: Tue, 26 Nov 2024 14:13:32 -0800 Subject: [PATCH] Adicionar src/app/admin/login/page.jsx --- src/app/admin/login/page.jsx | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/app/admin/login/page.jsx diff --git a/src/app/admin/login/page.jsx b/src/app/admin/login/page.jsx new file mode 100644 index 0000000..f21030d --- /dev/null +++ b/src/app/admin/login/page.jsx @@ -0,0 +1,79 @@ +"use client"; +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; + +export default function LoginPage() { + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const router = useRouter(); + + const handleSubmit = async (e) => { + e.preventDefault(); + // Aqui virá a autenticação + if (email === 'admin@friascar.com' && password === 'admin123') { + // Salvar token ou session + router.push('/admin'); + } + }; + + return ( +
+
+
+
+

+ Admin Login +

+
+ +
+
+ +
+ setEmail(e.target.value)} + className="block w-full rounded-md border-0 p-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300" + /> +
+
+ +
+ +
+ setPassword(e.target.value)} + className="block w-full rounded-md border-0 p-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300" + /> +
+
+ +
+ +
+
+
+
+
+ ); +} \ No newline at end of file