diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 5b9ab4e..8586333 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -5,7 +5,25 @@ import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen'; export default function AdminPage() { - const [templates, setTemplates] = useState([]); + const [password, setPassword] = useState(""); + const [isAuthenticated, setIsAuthenticated] = useState(false); + const [templates, setTemplates] = useState([]); + + const handleLogin = () => { + if (password === "Arshia@41010") { + setIsAuthenticated(true); + } else { + alert("Invalid password"); + } + }; + + const addTemplate = () => { + setTemplates([...templates, { id: Date.now().toString(), name: "", description: "", price: "", free: false, image: "" }]); + }; + + const updateTemplate = (id: string, field: string, value: any) => { + setTemplates(templates.map(t => t.id === id ? { ...t, [field]: value } : t)); + }; return (
-

Admin Dashboard

-
-

Template Management

-
-

Upload new templates for the storefront.

- -
-
-

Current Templates

- {templates.length === 0 ? ( -

No templates uploaded yet.

- ) : ( -
{/* Template list logic */}
- )} -
-
+ {!isAuthenticated ? ( +
+

Admin Access

+ setPassword(e.target.value)} className="w-full p-2 mb-4 rounded bg-white/5" placeholder="Password" /> + +
+ ) : ( +
+
+

Admin Dashboard

+ +
+
+ {templates.map((t) => ( +
+ updateTemplate(t.id, 'name', e.target.value)} className="bg-transparent border p-1 rounded" /> + updateTemplate(t.id, 'description', e.target.value)} className="bg-transparent border p-1 rounded" /> + updateTemplate(t.id, 'price', e.target.value)} className="bg-transparent border p-1 rounded w-20" /> + +
+ ))} +
+
+ )}
);