From 1cab13dadf3ba91439c2ee467e62ba47346c631a Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 13 Mar 2026 19:33:18 +0000 Subject: [PATCH] Switch to version 1: remove src/app/admin/page.tsx --- src/app/admin/page.tsx | 406 ----------------------------------------- 1 file changed, 406 deletions(-) delete mode 100644 src/app/admin/page.tsx diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx deleted file mode 100644 index 32d5430..0000000 --- a/src/app/admin/page.tsx +++ /dev/null @@ -1,406 +0,0 @@ -"use client"; - -import { useState } from "react"; -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline"; -import FooterBaseCard from "@/components/sections/footer/FooterBaseCard"; -import { Plus, Trash2, Edit2, Package, BarChart3, AlertCircle } from "lucide-react"; - -interface Product { - id: string; - brand: string; - name: string; - price: string; - stock: number; - imageSrc: string; - imageAlt: string; -} - -interface InventoryItem { - id: string; - productName: string; - sku: string; - quantity: number; - lowStockThreshold: number; - lastUpdated: string; -} - -export default function AdminDashboard() { - const [products, setProducts] = useState([ - { - id: "prod-001", brand: "Nike", name: "Air Max 90 Classic", price: "$129.99", stock: 45, - imageSrc: "http://img.b2bpic.net/free-photo/athletic-girl-standing-stairs-tying-shoelaces_23-2148264960.jpg?_wi=2", imageAlt: "Nike Air Max 90 sneaker"}, - ]); - - const [inventory, setInventory] = useState([ - { - id: "inv-001", productName: "Air Max 90 Classic", sku: "NIKE-AM90-001", quantity: 45, - lowStockThreshold: 10, - lastUpdated: "2025-01-17"}, - ]); - - const [showAddProduct, setShowAddProduct] = useState(false); - const [editingProduct, setEditingProduct] = useState(null); - const [newProduct, setNewProduct] = useState>({ - brand: "", name: "", price: "", stock: 0, - imageSrc: "", imageAlt: ""}); - - const navItems = [ - { name: "Dashboard", id: "dashboard" }, - { name: "Products", id: "products" }, - { name: "Inventory", id: "inventory" }, - { name: "Orders", id: "orders" }, - { name: "Analytics", id: "analytics" }, - ]; - - const footerColumns = [ - { - title: "Admin", items: [ - { label: "Dashboard", href: "/admin" }, - { label: "Products", href: "/admin" }, - { label: "Settings", href: "/admin" }, - ], - }, - { - title: "Support", items: [ - { label: "Documentation", href: "#" }, - { label: "Help Center", href: "#" }, - { label: "Contact", href: "#" }, - ], - }, - ]; - - const handleAddProduct = () => { - if (newProduct.brand && newProduct.name && newProduct.price && newProduct.stock !== undefined) { - const product: Product = { - id: `prod-${Date.now()}`, - brand: newProduct.brand || "", name: newProduct.name || "", price: newProduct.price || "", stock: newProduct.stock || 0, - imageSrc: newProduct.imageSrc || "", imageAlt: newProduct.imageAlt || ""}; - setProducts([...products, product]); - setNewProduct({ brand: "", name: "", price: "", stock: 0, imageSrc: "", imageAlt: "" }); - setShowAddProduct(false); - } - }; - - const handleDeleteProduct = (id: string) => { - setProducts(products.filter((p) => p.id !== id)); - }; - - const handleUpdateStock = (id: string, newStock: number) => { - setProducts(products.map((p) => (p.id === id ? { ...p, stock: newStock } : p))); - }; - - return ( - - - -
-
- {/* Header Section */} -
-

Admin Dashboard

-

Manage products, inventory, and store operations

-
- - {/* Stats Cards */} -
-
-
-
-

Total Products

-

{products.length}

-
- -
-
-
-
-
-

Total Stock

-

- {products.reduce((sum, p) => sum + p.stock, 0)} -

-
- -
-
-
-
-
-

Low Stock Items

-

- {inventory.filter((item) => item.quantity < item.lowStockThreshold).length} -

-
- -
-
-
-
-
-

Revenue Ready

-

100%

-
- -
-
-
- - {/* Product Management Section */} -
-
-
-

Product Management

-

Add, edit, and manage your product catalog

-
- -
- - {/* Add Product Form */} - {showAddProduct && ( -
-

New Product

-
- setNewProduct({ ...newProduct, brand: e.target.value })} - className="px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" - /> - setNewProduct({ ...newProduct, name: e.target.value })} - className="px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" - /> - setNewProduct({ ...newProduct, price: e.target.value })} - className="px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" - /> - setNewProduct({ ...newProduct, stock: parseInt(e.target.value) || 0 })} - className="px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" - /> - setNewProduct({ ...newProduct, imageSrc: e.target.value })} - className="px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 md:col-span-2" - /> -
-
- - -
-
- )} - - {/* Products Table */} -
- - - - - - - - - - - - {products.map((product) => ( - - - - - - - - ))} - -
ProductBrandPriceStockActions
{product.name}{product.brand}{product.price} -
- handleUpdateStock(product.id, parseInt(e.target.value) || 0)} - className="w-16 px-2 py-1 border border-slate-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-blue-500" - /> - units -
-
-
- - -
-
-
- - {products.length === 0 && ( -
- -

No products yet. Add your first product to get started.

-
- )} -
- - {/* Inventory Management Section */} -
-
-

Inventory Management

-

Track stock levels and manage inventory alerts

-
- -
- - - - - - - - - - - - - {inventory.map((item) => { - const isLowStock = item.quantity < item.lowStockThreshold; - return ( - - - - - - - - - ); - })} - -
ProductSKUQuantityLow Stock AlertStatusLast Updated
{item.productName}{item.sku}{item.quantity}{item.lowStockThreshold} - {isLowStock ? ( - - - Low Stock - - ) : ( - - In Stock - - )} - {item.lastUpdated}
-
- - {inventory.length === 0 && ( -
- -

No inventory items yet.

-
- )} -
- - {/* Content Sections Ready for Admin */} -
-

Content Management

-
-
-

Featured Products Section

-

Manage featured products display

-
-
-

New Arrivals Section

-

Update new arrivals content

-
-
-

Best Sellers Section

-

Configure best sellers display

-
-
-

Brands Section

-

Manage brand partners

-
-
-

Testimonials Section

-

Add customer testimonials

-
-
-

FAQ Section

-

Update frequently asked questions

-
-
-
-
-
- - -
- ); -}