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 { useState } from "react";
3import Link from "next/link";
4
5export default function ConfigPage() {
6 const [activeSection, setActiveSection] = useState<string>("general");
7
8 const sections = [
9 { id: "general", title: "General", icon: "โš™๏ธ" },
10 { id: "pos", title: "POS Settings", icon: "๐Ÿ›’" },
11 { id: "hardware", title: "Hardware", icon: "๐Ÿ–จ๏ธ" },
12 { id: "payments", title: "Payment Methods", icon: "๐Ÿ’ณ" },
13 { id: "taxes", title: "Tax Configuration", icon: "๐Ÿ“Š" },
14 { id: "receipts", title: "Receipts", icon: "๐Ÿงพ" },
15 { id: "security", title: "Security", icon: "๐Ÿ”" },
16 { id: "integrations", title: "Integrations", icon: "๐Ÿ”—" }
17 ];
18
19 return (
20 <div className="min-h-screen bg-gray-50">
21 <div className="max-w-7xl mx-auto p-6">
22 <div className="mb-8">
23 <h1 className="text-3xl font-bold text-gray-900 mb-2">System Configuration</h1>
24 <p className="text-gray-600">Configure system settings, hardware, and integrations</p>
25 </div>
26
27 <div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
28 {/* Sidebar */}
29 <div className="lg:col-span-1">
30 <div className="bg-white rounded-lg shadow-sm border border-gray-200 p-4 sticky top-6">
31 <h2 className="text-sm font-semibold text-gray-500 uppercase mb-3">Settings</h2>
32 <nav className="space-y-1">
33 {sections.map((section) => (
34 <button
35 key={section.id}
36 onClick={() => setActiveSection(section.id)}
37 className={`w-full text-left px-3 py-2 rounded-md text-sm transition-colors ${
38 activeSection === section.id
39 ? "bg-blue-50 text-blue-700 font-medium"
40 : "text-gray-700 hover:bg-gray-50"
41 }`}
42 >
43 <span className="mr-2">{section.icon}</span>
44 {section.title}
45 </button>
46 ))}
47 </nav>
48 <div className="mt-6 pt-6 border-t border-gray-200">
49 <Link
50 href="/pages/settings/stores"
51 className="text-sm text-blue-600 hover:text-blue-700 block mb-2"
52 >
53 โ†’ Store Settings
54 </Link>
55 <Link
56 href="/pages/settings/staff"
57 className="text-sm text-blue-600 hover:text-blue-700 block"
58 >
59 โ†’ Staff Management
60 </Link>
61 </div>
62 </div>
63 </div>
64
65 {/* Content */}
66 <div className="lg:col-span-3">
67 <div className="bg-white rounded-lg shadow-sm border border-gray-200 p-6">
68 {activeSection === "general" && (
69 <div>
70 <h2 className="text-2xl font-bold text-gray-900 mb-6">General Settings</h2>
71
72 <div className="space-y-6">
73 <div className="border-b border-gray-200 pb-4">
74 <label className="block text-sm font-medium text-gray-700 mb-2">
75 Business Name
76 </label>
77 <input
78 type="text"
79 defaultValue="EverydayPOS"
80 className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
81 />
82 </div>
83
84 <div className="border-b border-gray-200 pb-4">
85 <label className="block text-sm font-medium text-gray-700 mb-2">
86 Default Currency
87 </label>
88 <select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
89 <option>USD - US Dollar</option>
90 <option>EUR - Euro</option>
91 <option>GBP - British Pound</option>
92 <option>AUD - Australian Dollar</option>
93 <option>NZD - New Zealand Dollar</option>
94 </select>
95 </div>
96
97 <div className="border-b border-gray-200 pb-4">
98 <label className="block text-sm font-medium text-gray-700 mb-2">
99 Time Zone
100 </label>
101 <select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
102 <option>Pacific/Auckland (NZST)</option>
103 <option>Australia/Sydney (AEDT)</option>
104 <option>America/Los_Angeles (PST)</option>
105 <option>America/New_York (EST)</option>
106 <option>Europe/London (GMT)</option>
107 </select>
108 </div>
109
110 <div className="border-b border-gray-200 pb-4">
111 <label className="flex items-center">
112 <input type="checkbox" className="mr-2" defaultChecked />
113 <span className="text-sm text-gray-700">Enable automatic backups</span>
114 </label>
115 </div>
116
117 <button className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition">
118 Save Changes
119 </button>
120 </div>
121 </div>
122 )}
123
124 {activeSection === "pos" && (
125 <div>
126 <h2 className="text-2xl font-bold text-gray-900 mb-6">POS Settings</h2>
127 <div className="bg-blue-50 border border-blue-200 rounded-lg p-6 text-center">
128 <div className="text-4xl mb-4">๐Ÿ›’</div>
129 <p className="text-gray-700">POS configuration options coming soon</p>
130 </div>
131 </div>
132 )}
133
134 {activeSection === "hardware" && (
135 <div>
136 <h2 className="text-2xl font-bold text-gray-900 mb-6">Hardware Configuration</h2>
137 <div className="space-y-4">
138 <div className="border border-gray-200 rounded-lg p-4">
139 <h3 className="font-semibold text-gray-900 mb-2">๐Ÿ–จ๏ธ Receipt Printers</h3>
140 <p className="text-sm text-gray-600 mb-3">Configure thermal and network printers</p>
141 <button className="px-3 py-1 text-sm bg-blue-600 text-white rounded hover:bg-blue-700">
142 Add Printer
143 </button>
144 </div>
145 <div className="border border-gray-200 rounded-lg p-4">
146 <h3 className="font-semibold text-gray-900 mb-2">๐Ÿ“ฑ Barcode Scanners</h3>
147 <p className="text-sm text-gray-600 mb-3">USB and Bluetooth scanner setup</p>
148 <button className="px-3 py-1 text-sm bg-blue-600 text-white rounded hover:bg-blue-700">
149 Add Scanner
150 </button>
151 </div>
152 <div className="border border-gray-200 rounded-lg p-4">
153 <h3 className="font-semibold text-gray-900 mb-2">๐Ÿ’ต Cash Drawers</h3>
154 <p className="text-sm text-gray-600 mb-3">Configure cash drawer kick mechanisms</p>
155 <button className="px-3 py-1 text-sm bg-blue-600 text-white rounded hover:bg-blue-700">
156 Add Cash Drawer
157 </button>
158 </div>
159 </div>
160 </div>
161 )}
162
163 {activeSection === "payments" && (
164 <div>
165 <h2 className="text-2xl font-bold text-gray-900 mb-6">Payment Methods</h2>
166 <div className="space-y-4">
167 <div className="flex items-center justify-between p-4 border border-gray-200 rounded-lg">
168 <div>
169 <h3 className="font-semibold text-gray-900">๐Ÿ’ต Cash</h3>
170 <p className="text-sm text-gray-600">Accept cash payments</p>
171 </div>
172 <label className="relative inline-flex items-center cursor-pointer">
173 <input type="checkbox" className="sr-only peer" defaultChecked />
174 <div className="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
175 </label>
176 </div>
177 <div className="flex items-center justify-between p-4 border border-gray-200 rounded-lg">
178 <div>
179 <h3 className="font-semibold text-gray-900">๐Ÿ’ณ Card Payments</h3>
180 <p className="text-sm text-gray-600">Credit/Debit card processing</p>
181 </div>
182 <label className="relative inline-flex items-center cursor-pointer">
183 <input type="checkbox" className="sr-only peer" defaultChecked />
184 <div className="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
185 </label>
186 </div>
187 <div className="flex items-center justify-between p-4 border border-gray-200 rounded-lg">
188 <div>
189 <h3 className="font-semibold text-gray-900">๐Ÿ“ฑ Digital Wallets</h3>
190 <p className="text-sm text-gray-600">Apple Pay, Google Pay, etc.</p>
191 </div>
192 <label className="relative inline-flex items-center cursor-pointer">
193 <input type="checkbox" className="sr-only peer" />
194 <div className="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
195 </label>
196 </div>
197 </div>
198 </div>
199 )}
200
201 {activeSection === "taxes" && (
202 <div>
203 <h2 className="text-2xl font-bold text-gray-900 mb-6">Tax Configuration</h2>
204 <div className="bg-green-50 border border-green-200 rounded-lg p-6 text-center">
205 <div className="text-4xl mb-4">๐Ÿ“Š</div>
206 <p className="text-gray-700">Tax rate configuration coming soon</p>
207 </div>
208 </div>
209 )}
210
211 {activeSection === "receipts" && (
212 <div>
213 <h2 className="text-2xl font-bold text-gray-900 mb-6">Receipt Configuration</h2>
214 <div className="bg-purple-50 border border-purple-200 rounded-lg p-6 text-center">
215 <div className="text-4xl mb-4">๐Ÿงพ</div>
216 <p className="text-gray-700">Receipt template editor coming soon</p>
217 </div>
218 </div>
219 )}
220
221 {activeSection === "security" && (
222 <div>
223 <h2 className="text-2xl font-bold text-gray-900 mb-6">Security Settings</h2>
224 <div className="space-y-4">
225 <div className="border-b border-gray-200 pb-4">
226 <label className="flex items-center">
227 <input type="checkbox" className="mr-2" defaultChecked />
228 <span className="text-sm text-gray-700">Require password for void/refund</span>
229 </label>
230 </div>
231 <div className="border-b border-gray-200 pb-4">
232 <label className="flex items-center">
233 <input type="checkbox" className="mr-2" defaultChecked />
234 <span className="text-sm text-gray-700">Enable audit logging</span>
235 </label>
236 </div>
237 <div className="border-b border-gray-200 pb-4">
238 <label className="flex items-center">
239 <input type="checkbox" className="mr-2" />
240 <span className="text-sm text-gray-700">Two-factor authentication</span>
241 </label>
242 </div>
243 <Link
244 href="/audit"
245 className="inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition"
246 >
247 View Audit Log
248 </Link>
249 </div>
250 </div>
251 )}
252
253 {activeSection === "integrations" && (
254 <div>
255 <h2 className="text-2xl font-bold text-gray-900 mb-6">Third-Party Integrations</h2>
256 <div className="space-y-4">
257 <div className="border border-gray-200 rounded-lg p-4">
258 <div className="flex items-center justify-between mb-2">
259 <h3 className="font-semibold text-gray-900">Fieldpine Backend</h3>
260 <span className="px-2 py-1 bg-green-100 text-green-800 text-xs rounded-full border border-green-200">
261 Connected
262 </span>
263 </div>
264 <p className="text-sm text-gray-600">Integrated retail management platform</p>
265 </div>
266 <div className="border border-gray-200 rounded-lg p-4 opacity-60">
267 <div className="flex items-center justify-between mb-2">
268 <h3 className="font-semibold text-gray-900">Accounting Software</h3>
269 <span className="px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded-full">
270 Not Connected
271 </span>
272 </div>
273 <p className="text-sm text-gray-600">QuickBooks, Xero, MYOB integration</p>
274 </div>
275 </div>
276 </div>
277 )}
278 </div>
279 </div>
280 </div>
281 </div>
282 </div>
283 );
284}