feat: add admin page
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user