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 { Icon } from '@/contexts/IconContext';
4
5export default function PrepayPage() {
6 const [activeTab, setActiveTab] = useState<"giftcards" | "vouchers" | "accounts">("giftcards");
7
8 return (
9 <div className="min-h-screen bg-surface-2">
10 <div className="max-w-7xl mx-auto p-6">
11 <div className="mb-8">
12 <h1 className="text-3xl font-bold text-text mb-2">Prepay & Gift Cards</h1>
13 <p className="text-muted">Manage gift cards, vouchers, and prepaid accounts</p>
14 </div>
15
16 {/* Tabs */}
17 <div className="bg-surface rounded-lg shadow-sm border border-border mb-6">
18 <div className="border-b border-border">
19 <nav className="flex -mb-px">
20 <button
21 onClick={() => setActiveTab("giftcards")}
22 className={`px-6 py-4 text-sm font-medium border-b-2 transition-colors ${
23 activeTab === "giftcards"
24 ? "border-brand text-brand"
25 : "border-transparent text-muted hover:text-text hover:border-border"
26 }`}
27 >
28 <Icon name="card_giftcard" size={20} className="inline mr-2" />Gift Cards
29 </button>
30 <button
31 onClick={() => setActiveTab("vouchers")}
32 className={`px-6 py-4 text-sm font-medium border-b-2 transition-colors ${
33 activeTab === "vouchers"
34 ? "border-brand text-brand"
35 : "border-transparent text-muted hover:text-text hover:border-border"
36 }`}
37 >
38 <Icon name="confirmation_number" size={20} className="inline mr-2" />Vouchers
39 </button>
40 <button
41 onClick={() => setActiveTab("accounts")}
42 className={`px-6 py-4 text-sm font-medium border-b-2 transition-colors ${
43 activeTab === "accounts"
44 ? "border-brand text-brand"
45 : "border-transparent text-muted hover:text-text hover:border-border"
46 }`}
47 >
48 <Icon name="account_balance_wallet" size={20} className="inline mr-2" />Prepaid Accounts
49 </button>
50 </nav>
51 </div>
52
53 <div className="p-6">
54 {activeTab === "giftcards" && (
55 <div>
56 <div className="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
57 <div className="bg-surface border border-border rounded-lg p-6">
58 <h3 className="text-lg font-bold text-text mb-2">Issue New Gift Card</h3>
59 <p className="text-muted text-sm mb-4">Create and activate a new gift card</p>
60 <button className="px-4 py-2 bg-brand text-white rounded hover:bg-brand/90 transition">
61 Issue Gift Card
62 </button>
63 </div>
64
65 <div className="bg-surface border border-border rounded-lg p-6">
66 <h3 className="text-lg font-bold text-text mb-2">Check Balance</h3>
67 <p className="text-muted text-sm mb-4">Look up gift card balance and history</p>
68 <button className="px-4 py-2 bg-success text-white rounded hover:bg-success/80 transition">
69 Check Balance
70 </button>
71 </div>
72 </div>
73
74 <div className="bg-surface border border-border rounded-lg p-6">
75 <h3 className="font-semibold text-text mb-4">Recent Gift Card Activity</h3>
76 <div className="text-center text-muted py-8">
77 No recent gift card transactions
78 </div>
79 </div>
80 </div>
81 )}
82
83 {activeTab === "vouchers" && (
84 <div>
85 <div className="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
86 <div className="bg-surface border border-border rounded-lg p-6">
87 <h3 className="text-lg font-bold text-text mb-2">Create Voucher</h3>
88 <p className="text-muted text-sm mb-4">Generate discount or value vouchers</p>
89 <button className="px-4 py-2 bg-info text-white rounded hover:bg-info/80 transition">
90 Create Voucher
91 </button>
92 </div>
93
94 <div className="bg-surface border border-border rounded-lg p-6">
95 <h3 className="text-lg font-bold text-text mb-2">Redeem Voucher</h3>
96 <p className="text-muted text-sm mb-4">Process voucher redemption</p>
97 <button className="px-4 py-2 bg-accent text-white rounded hover:bg-accent/80 transition">
98 Redeem
99 </button>
100 </div>
101 </div>
102
103 <div className="bg-surface border border-border rounded-lg p-6">
104 <h3 className="font-semibold text-text mb-4">Active Vouchers</h3>
105 <div className="text-center text-muted py-8">
106 No active vouchers
107 </div>
108 </div>
109 </div>
110 )}
111
112 {activeTab === "accounts" && (
113 <div>
114 <div className="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
115 <div className="bg-surface border border-border rounded-lg p-4">
116 <div className="text-sm text-muted mb-1">Total Accounts</div>
117 <div className="text-2xl font-bold text-text">0</div>
118 </div>
119 <div className="bg-surface border border-border rounded-lg p-4">
120 <div className="text-sm text-muted mb-1">Total Balance</div>
121 <div className="text-2xl font-bold text-text">$0.00</div>
122 </div>
123 <div className="bg-surface border border-border rounded-lg p-4">
124 <div className="text-sm text-muted mb-1">Active This Month</div>
125 <div className="text-2xl font-bold text-text">0</div>
126 </div>
127 </div>
128
129 <div className="bg-surface border border-border rounded-lg p-6">
130 <h3 className="font-semibold text-text mb-4">Prepaid Account List</h3>
131 <div className="text-center text-muted py-8">
132 No prepaid accounts found
133 </div>
134 </div>
135 </div>
136 )}
137 </div>
138 </div>
139
140 {/* Info Box */}
141 <div className="bg-surface border border-border rounded-lg p-6">
142 <div className="flex items-start">
143 <div className="text-2xl mr-3"><Icon name="construction" size={28} /></div>
144 <div>
145 <h3 className="font-semibold text-text mb-2">Prepay System Under Development</h3>
146 <p className="text-muted text-sm">
147 The full prepay and gift card management system is being developed. This will include:
148 </p>
149 <ul className="list-disc list-inside text-muted text-sm mt-2 space-y-1 ml-2">
150 <li>Physical and digital gift card issuance</li>
151 <li>Balance checking and top-up functionality</li>
152 <li>Voucher creation with custom rules and expiry</li>
153 <li>Prepaid account management with transaction history</li>
154 <li>Integration with POS for redemption</li>
155 <li>Reporting and analytics for prepay programs</li>
156 </ul>
157 </div>
158 </div>
159 </div>
160 </div>
161 </div>
162 );
163}