feat: add admin page

This commit is contained in:
2026-06-24 20:15:20 +03:00
parent 45d1353091
commit 2c22cee60b
3 changed files with 168 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
import { useState } from "react";
import PageLayout from "../components/PageLayout";
import AdminItems from "../components/AdminItems";
// import AdminOrders from "../components/AdminOrders"; // добавим позже
// import AdminStaff from "../components/AdminStaff"; // добавим позже
export default function AdminPage() {
const [tab, setTab] = useState("items");
const tabs = [
{ key: "items", label: "Товары" },
{ key: "orders", label: "Заказы" },
{ key: "staff", label: "Сотрудники" },
];
return (
<PageLayout>
<main className="px-6 md:px-16 grow w-full mb-10 text-white">
<h1 className="text-2xl md:text-4xl font-medium uppercase mb-8">
Админ-панель
</h1>
{/* Вкладки */}
<div className="flex gap-2 mb-8 border-b border-white/10">
{tabs.map((t) => (
<button
key={t.key}
onClick={() => setTab(t.key)}
className={`px-4 py-2 text-sm uppercase transition-colors ${tab === t.key
? "text-white border-b-2 border-gold"
: "text-white/50 hover:text-white/80"
}`}
>
{t.label}
</button>
))}
</div>
{/* Содержимое активной вкладки */}
{tab === "items" && <AdminItems />}
{tab === "orders" && (
<p className="text-white/50">Раздел заказов в разработке</p>
)}
{tab === "staff" && (
<p className="text-white/50">Раздел сотрудников в разработке</p>
)}
</main>
</PageLayout>
);
}