feat: add product catalog management page
This commit is contained in:
1 parent
aea6fa4127
commit
060dc39fdd
2 files changed
+96
-1
No files matched your search
@@ -3,6 +3,7 @@ import Layout from './components/Layout';
|
||||
import Dashboard from './pages/Dashboard';
|
||||
import Login from './pages/Login';
|
||||
import Users from './pages/Users';
|
||||
import Products from './pages/Products';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
@@ -12,7 +13,7 @@ function App() {
|
||||
<Route path="/" element={<Layout />}>
|
||||
<Route index element={<Dashboard />} />
|
||||
<Route path="users" element={<Users />} />
|
||||
<Route path="products" element={<div className="p-4">مدیریت محصولات</div>} />
|
||||
<Route path="products" element={<Products />} />
|
||||
<Route path="orders" element={<div className="p-4">مدیریت سفارشات</div>} />
|
||||
<Route path="coupons" element={<div className="p-4">کدهای تخفیف</div>} />
|
||||
<Route path="settings" element={<div className="p-4">تنظیمات سیستم</div>} />
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import { Package, Plus, Edit3, Trash2, Search, Filter } from 'lucide-react';
|
||||
|
||||
const products = [
|
||||
{ id: 1, nameFa: 'کانینا بیوتین فورت', category: 'پوست و مو', price: '۲,۵۰۰,۰۰۰', stock: 45, status: 'موجود' },
|
||||
{ id: 2, nameFa: 'کانینا پِتویتال', category: 'مفاصل', price: '۳,۲۰۰,۰۰۰', stock: 12, status: 'موجود' },
|
||||
{ id: 3, nameFa: 'شیر خشک مخصوص سگ', category: 'رشد توله', price: '۱,۸۰۰,۰۰۰', stock: 0, status: 'ناموجود' },
|
||||
{ id: 4, nameFa: 'قطره تمیزکننده چشم', category: 'بهداشتی', price: '۹۵۰,۰۰۰', stock: 120, status: 'موجود' },
|
||||
];
|
||||
|
||||
export default function Products() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
|
||||
<div>
|
||||
<h2 className="text-2xl font-black text-gray-900 flex items-center gap-2">
|
||||
<Package className="w-6 h-6 text-purple-600" />
|
||||
مدیریت محصولات
|
||||
</h2>
|
||||
<p className="text-gray-500 font-medium mt-1">مدیریت کاتالوگ، موجودی انبار و اطلاعات SEO</p>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="relative">
|
||||
<Search className="w-5 h-5 text-gray-400 absolute right-3 top-1/2 -translate-y-1/2" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="جستجوی محصول..."
|
||||
className="pl-4 pr-10 py-2 border border-gray-200 rounded-xl outline-none focus:ring-2 focus:ring-purple-500 w-full sm:w-64 font-medium"
|
||||
/>
|
||||
</div>
|
||||
<button className="bg-purple-600 text-white px-4 py-2 rounded-xl flex items-center gap-2 font-bold hover:bg-purple-700 transition-all shadow-md shadow-purple-200">
|
||||
<Plus className="w-5 h-5" />
|
||||
محصول جدید
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-right font-vazir">
|
||||
<thead className="bg-gray-50 text-gray-500 text-sm border-b border-gray-200">
|
||||
<tr>
|
||||
<th className="py-4 px-6 font-bold">نام محصول</th>
|
||||
<th className="py-4 px-6 font-bold">دستهبندی</th>
|
||||
<th className="py-4 px-6 font-bold">قیمت (تومان)</th>
|
||||
<th className="py-4 px-6 font-bold">موجودی</th>
|
||||
<th className="py-4 px-6 font-bold">وضعیت</th>
|
||||
<th className="py-4 px-6 font-bold text-center">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-gray-100">
|
||||
{products.map((product) => (
|
||||
<tr key={product.id} className="hover:bg-gray-50/50 transition-colors">
|
||||
<td className="py-4 px-6 font-bold text-gray-900">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-10 h-10 bg-gray-100 rounded-lg flex items-center justify-center">
|
||||
<Package className="w-5 h-5 text-gray-400" />
|
||||
</div>
|
||||
{product.nameFa}
|
||||
</div>
|
||||
</td>
|
||||
<td className="py-4 px-6 text-gray-500">{product.category}</td>
|
||||
<td className="py-4 px-6 font-bold text-gray-900">{product.price}</td>
|
||||
<td className="py-4 px-6">
|
||||
<span className={`font-bold ${product.stock < 10 ? 'text-red-500' : 'text-gray-900'}`}>
|
||||
{product.stock} عدد
|
||||
</span>
|
||||
</td>
|
||||
<td className="py-4 px-6">
|
||||
<span className={`px-3 py-1 rounded-full text-xs font-bold ${
|
||||
product.stock > 0 ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700'
|
||||
}`}>
|
||||
{product.status}
|
||||
</span>
|
||||
</td>
|
||||
<td className="py-4 px-6">
|
||||
<div className="flex items-center justify-center gap-2">
|
||||
<button className="text-blue-600 hover:bg-blue-50 p-2 rounded-lg transition-colors" title="ویرایش">
|
||||
<Edit3 className="w-4 h-4" />
|
||||
</button>
|
||||
<button className="text-red-600 hover:bg-red-50 p-2 rounded-lg transition-colors" title="حذف">
|
||||
<Trash2 className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user