Ritz Token Initialized

This commit is contained in:
Sidharth Prabhu
2026-04-20 14:45:52 +05:30
parent 839343de14
commit 2a51622450
22 changed files with 551 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Search, User, Phone, Tag, ChevronRight, UserCheck, UserMinus, MoreVertical, LayoutGrid, List, Edit2, Trash2, Shield, X, Eye, EyeOff, Loader2, AlertCircle, CheckCircle } from 'lucide-react';
import { Search, User, Phone, Tag, ChevronRight, UserCheck, UserMinus, MoreVertical, LayoutGrid, List, Edit2, Trash2, Shield, X, Eye, EyeOff, Loader2, AlertCircle, CheckCircle, CircleDollarSign } from 'lucide-react';
import Pagination from '../components/Pagination';
interface UserDto {
@@ -7,6 +7,7 @@ interface UserDto {
mobileNumber: string;
name: string;
loggedIn: boolean;
ritzTokenBalance: number;
}
const Customers: React.FC = () => {
@@ -241,6 +242,7 @@ const Customers: React.FC = () => {
<th className="px-6 py-4 text-xs font-bold text-[#64748b] uppercase tracking-wider">Customer Info</th>
<th className="px-6 py-4 text-xs font-bold text-[#64748b] uppercase tracking-wider">Contact Info</th>
<th className="px-6 py-4 text-xs font-bold text-[#64748b] uppercase tracking-wider">Membership</th>
<th className="px-6 py-4 text-xs font-bold text-[#64748b] uppercase tracking-wider">Wallet Balance</th>
<th className="px-6 py-4 text-xs font-bold text-[#64748b] uppercase tracking-wider">Status</th>
<th className="px-6 py-4 text-xs font-bold text-[#64748b] uppercase tracking-wider text-right">Actions</th>
</tr>
@@ -271,6 +273,21 @@ const Customers: React.FC = () => {
REGULAR CUSTOMER
</span>
</td>
<td className="px-6 py-4">
<div className="flex items-center gap-2">
<div className="w-8 h-8 bg-indigo-50 rounded-lg flex items-center justify-center text-indigo-600">
<CircleDollarSign size={16} />
</div>
<span className="text-sm font-black text-[#231651]">
R{user.ritzTokenBalance?.toLocaleString() || '0'}
</span>
</div>
</td>
<td className="px-6 py-4">
<span className="text-sm font-bold text-[#231651]">
R{user.ritzTokenBalance?.toLocaleString() || '0'}
</span>
</td>
<td className="px-6 py-4">
<span className={`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-bold ${
user.loggedIn
@@ -301,7 +318,7 @@ const Customers: React.FC = () => {
))
) : (
<tr>
<td colSpan={5} className="px-6 py-12 text-center text-[#64748b]">
<td colSpan={6} className="px-6 py-12 text-center text-[#64748b]">
<div className="flex flex-col items-center justify-center">
<User size={40} className="mb-2 opacity-20" />
<p className="font-medium">No customers found</p>
@@ -346,6 +363,9 @@ const Customers: React.FC = () => {
<span className="px-2 py-0.5 bg-blue-50 text-blue-600 text-[10px] font-bold rounded-lg border border-blue-100 uppercase tracking-wider">
RIT STUDENT
</span>
<span className="px-2 py-0.5 bg-indigo-50 text-indigo-600 text-[10px] font-bold rounded-lg border border-indigo-100 uppercase tracking-wider">
R{user.ritzTokenBalance?.toLocaleString() || '0'} TOKENS
</span>
</div>
<button onClick={() => handleEditClick(user)} className="w-full py-2.5 bg-gray-50 border border-[#e2e8f0] text-[#1e293b] hover:bg-[#231651] hover:text-white rounded-xl flex items-center justify-center gap-2 text-sm font-bold transition-all">