EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
page.tsx
Go to the documentation of this file.
1"use client";
2
3import { Icon } from '@/contexts/IconContext';
4
5export default function InactiveProductsReport() {
6 // Mock data - replace with actual API call
7 const products = [
8 { id: 1, sku: "OLD-001", name: "Discontinued Toner Cartridge", lastSale: "2023-06-15", daysInactive: 580, stock: 5 },
9 { id: 2, sku: "OLD-002", name: "Legacy USB Hub", lastSale: "2023-09-20", daysInactive: 483, stock: 12 },
10 { id: 3, sku: "OLD-003", name: "Obsolete Mouse Model", lastSale: "2024-01-10", daysInactive: 367, stock: 8 },
11 ];
12
13 return (
14 <div className="p-6 min-h-screen bg-bg">
15 <div className="mb-6">
16 <div className="flex items-center gap-3 mb-2">
17 <a href="/pages/reports?source=advisor" className="text-muted hover:text-brand">
18 <Icon name="arrow_back" size={24} />
19 </a>
20 <h1 className="text-3xl font-bold text-text">Inactive Products</h1>
21 </div>
22 <p className="text-muted ml-9">
23 Products with no sales activity for extended periods
24 </p>
25 </div>
26
27 <div className="bg-surface rounded-lg shadow-sm border border-border overflow-hidden">
28 <div className="overflow-x-auto">
29 <table className="w-full">
30 <thead className="bg-[var(--brand)] text-surface">
31 <tr>
32 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
33 SKU
34 </th>
35 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
36 Product Name
37 </th>
38 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
39 Last Sale
40 </th>
41 <th className="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider">
42 Days Inactive
43 </th>
44 <th className="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider">
45 Current Stock
46 </th>
47 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
48 Actions
49 </th>
50 </tr>
51 </thead>
52 <tbody className="divide-y divide-border">
53 {products.length === 0 ? (
54 <tr>
55 <td colSpan={6} className="px-6 py-12 text-center">
56 <Icon name="check_circle" size={48} className="text-success mx-auto mb-3" />
57 <p className="text-muted">No inactive products found</p>
58 </td>
59 </tr>
60 ) : (
61 products.map((product) => (
62 <tr key={product.id} className="hover:bg-surface-2">
63 <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-text">
64 {product.sku}
65 </td>
66 <td className="px-6 py-4 text-sm text-text">
67 {product.name}
68 </td>
69 <td className="px-6 py-4 whitespace-nowrap text-sm text-muted">
70 {product.lastSale}
71 </td>
72 <td className="px-6 py-4 whitespace-nowrap text-right">
73 <span className={`px-2 py-1 text-xs rounded ${
74 product.daysInactive >= 365 ? 'bg-error/20 text-error' :
75 product.daysInactive >= 180 ? 'bg-warning/20 text-warning' :
76 'bg-surface-2 text-muted'
77 }`}>
78 {product.daysInactive} days
79 </span>
80 </td>
81 <td className="px-6 py-4 whitespace-nowrap text-sm text-right text-muted">
82 {product.stock}
83 </td>
84 <td className="px-6 py-4 whitespace-nowrap text-sm">
85 <button className="text-warning hover:text-warning/80 mr-3">
86 Discount
87 </button>
88 <button className="text-error hover:text-error/80 mr-3">
89 Discontinue
90 </button>
91 <button className="text-info hover:text-info/80">
92 View
93 </button>
94 </td>
95 </tr>
96 ))
97 )}
98 </tbody>
99 </table>
100 </div>
101 </div>
102 </div>
103 );
104}