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";
2import { Icon } from '@/contexts/IconContext';
3
4export default function StockLevelIssues() {
5 const data = [
6 {
7 id: 1,
8 sku: "CART-128",
9 name: "HP 61XL Black",
10 currentStock: 2,
11 minStock: 10,
12 maxStock: 50,
13 issueType: "understock",
14 location: "Main Store"
15 },
16 {
17 id: 2,
18 sku: "PAPER-A4-500",
19 name: "A4 Paper 500 Sheet",
20 currentStock: 250,
21 minStock: 50,
22 maxStock: 200,
23 issueType: "overstock",
24 location: "Warehouse"
25 },
26 {
27 id: 3,
28 sku: "USB-HUB-7P",
29 name: "7 Port USB Hub",
30 currentStock: 0,
31 minStock: 5,
32 maxStock: 20,
33 issueType: "zero",
34 location: "Branch Store"
35 }
36 ];
37
38 return (
39 <div className="p-6 min-h-screen bg-bg">
40 {/* Header with back button */}
41 <div className="mb-6">
42 <div className="flex items-center gap-3 mb-2">
43 <a
44 href="/pages/reports?source=advisor"
45 className="text-muted hover:text-brand transition-colors"
46 >
47 <Icon name="arrow_back" size={24} />
48 </a>
49 <h1 className="text-3xl font-bold text-text">Stock Level Issues</h1>
50 </div>
51 <p className="text-muted ml-9">
52 Products with stock levels outside recommended ranges
53 </p>
54 </div>
55
56 {/* Table */}
57 <div className="bg-surface rounded-lg shadow-sm border border-border overflow-hidden">
58 <div className="overflow-x-auto">
59 <table className="w-full">
60 <thead className="bg-[var(--brand)] text-surface">
61 <tr>
62 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
63 SKU
64 </th>
65 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
66 Product Name
67 </th>
68 <th className="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider">
69 Current Stock
70 </th>
71 <th className="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider">
72 Min / Max
73 </th>
74 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
75 Issue Type
76 </th>
77 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
78 Location
79 </th>
80 <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
81 Actions
82 </th>
83 </tr>
84 </thead>
85 <tbody className="divide-y divide-border">
86 {data.length === 0 ? (
87 <tr>
88 <td colSpan={7} className="px-6 py-12 text-center">
89 <Icon name="check_circle" size={48} className="text-success mx-auto mb-3" />
90 <p className="text-muted font-medium">All stock levels are optimal</p>
91 <p className="text-muted-2 text-sm mt-1">No stock issues detected</p>
92 </td>
93 </tr>
94 ) : (
95 data.map((row) => (
96 <tr key={row.id} className="hover:bg-surface-2 transition-colors">
97 <td className="px-6 py-4 text-sm font-medium text-text">
98 {row.sku}
99 </td>
100 <td className="px-6 py-4 text-sm text-text">
101 {row.name}
102 </td>
103 <td className="px-6 py-4 text-sm text-right">
104 <span className={`font-medium ${
105 row.issueType === 'zero' ? 'text-error' :
106 row.issueType === 'understock' ? 'text-warning' :
107 'text-info'
108 }`}>
109 {row.currentStock}
110 </span>
111 </td>
112 <td className="px-6 py-4 text-sm text-muted text-right">
113 {row.minStock} / {row.maxStock}
114 </td>
115 <td className="px-6 py-4">
116 <span className={`px-2 py-1 text-xs font-medium rounded ${
117 row.issueType === 'zero' ? 'bg-error/20 text-error' :
118 row.issueType === 'understock' ? 'bg-warning/20 text-warning' :
119 'bg-info/20 text-info'
120 }`}>
121 {row.issueType === 'zero' ? 'OUT OF STOCK' :
122 row.issueType === 'understock' ? 'LOW STOCK' :
123 'OVERSTOCK'}
124 </span>
125 </td>
126 <td className="px-6 py-4 text-sm text-muted">
127 {row.location}
128 </td>
129 <td className="px-6 py-4 text-sm space-x-3">
130 {row.issueType === 'overstock' ? (
131 <>
132 <a href="#" className="text-brand hover:text-brand2 transition-colors">
133 Adjust
134 </a>
135 <a href="#" className="text-muted hover:text-text transition-colors">
136 Transfer
137 </a>
138 </>
139 ) : (
140 <>
141 <a href="#" className="text-brand hover:text-brand2 transition-colors">
142 Order
143 </a>
144 <a href="#" className="text-muted hover:text-text transition-colors">
145 Review
146 </a>
147 </>
148 )}
149 </td>
150 </tr>
151 ))
152 )}
153 </tbody>
154 </table>
155 </div>
156 </div>
157 </div>
158 );
159}