import { useState } from 'react';
import {
BarChart, Activity, Users, Zap, Clock, Filter,
Download, Search, Bell, Home, CreditCard, Settings,
Plus, Edit, Trash, ChevronDown, Power, History, ExternalLink, HelpCircle, AlertCircle, ChevronRight,
Tag, Gift, Sparkles, Timer, Shield, Percent
} from 'lucide-react';
export default function UserInterface() {
const [activeTab, setActiveTab] = useState('home');
const [activePage, setActivePage] = useState('dashboard');
const [showCustomerModal, setShowCustomerModal] = useState(false);
const [showMeterModal, setShowMeterModal] = useState(false);
const renderPage = () => {
switch(activePage) {
case 'dashboard':
return ;
case 'customers':
return ;
case 'meters':
return ;
case 'payments':
return ;
case 'admin':
return ;
default:
return ;
}
};
return (
{/* Top Navigation */}
EP Power
John Doe
{/* Sidebar */}
Equatorial Power
}
text="Dashboard"
active={activePage === 'dashboard'}
onClick={() => setActivePage('dashboard')}
/>
}
text="Customers"
active={activePage === 'customers'}
onClick={() => setActivePage('customers')}
/>
}
text="Meters"
active={activePage === 'meters'}
onClick={() => setActivePage('meters')}
/>
}
text="Payments"
active={activePage === 'payments'}
onClick={() => setActivePage('payments')}
/>
}
text="Admin"
active={activePage === 'admin'}
onClick={() => setActivePage('admin')}
/>
{/* Bottom Navigation (Mobile) */}
} text="Home" active={activeTab === 'home'} onClick={() => setActiveTab('home')} />
} text="Pay" active={activeTab === 'pay'} onClick={() => setActiveTab('pay')} />
} text="Usage" active={activeTab === 'usage'} onClick={() => setActiveTab('usage')} />
} text="Account" active={activeTab === 'account'} onClick={() => setActiveTab('account')} />
{/* Main Content */}
{activeTab === 'home' && }
{activeTab === 'pay' && }
{activeTab === 'usage' && }
{activeTab === 'account' && }
{renderPage()}
{/* Modals */}
{showCustomerModal &&
setShowCustomerModal(false)} />}
{showMeterModal && setShowMeterModal(false)} />}
);
}
const NavButton = ({ icon, text, active, onClick }) => (
{icon}
{text}
);
// Navigation Item Component
const NavItem = ({ icon, text, active, onClick }) => (
{icon}
{text}
);
// Dashboard Page Component
const DashboardPage = () => (
{/* Stats Grid */}
} title="Total Customers" value="2,451" color="green" />
} title="Active Meters" value="1,987" color="blue" />
} title="Energy Usage" value="45.2 kWh" color="yellow" />
} title="Pending Tickets" value="12" color="purple" />
{/* Recent Activity */}
Recent Activity
Customer
Action
Status
Time
John Doe
Payment Received
Completed
2 minutes ago
Sarah Smith
Meter Registration
Pending
15 minutes ago
Mike Johnson
Support Ticket
In Progress
1 hour ago
);
// Customers Page Component
const CustomersPage = () => (
Name
ID
Status
Last Payment
Actions
{/* Add customer rows here */}
);
// Meters Page Component
const MetersPage = () => (
{/* Meter Cards */}
{/* Add more meter cards */}
);
// Payments Page Component
const PaymentsPage = () => (
Recent Transactions
Transaction ID
Customer
Amount
Status
Date
{/* Add transaction rows here */}
);
// Admin Page Component
const AdminPage = () => (
User Management
Manage System Users
Role Permissions
Access Logs
System Settings
Payment Gateway Configuration
Notification Settings
System Backup
);
// Utility Components
const StatCard = ({ icon, title, value, color }) => (
);
const MeterCard = ({ id, customer, status, consumption }) => (
Consumption: {consumption}
);
const HomeView = () => (
{/* Current Usage Card */}
245 kWh
Last updated: 2 mins ago
{/* New Special Offers Section */}
Special Offers
View All
{/* Early Payment Discount Offer */}
Limited Time Offer
Early Payment Discount
Pay before the 15th and get 10% off your bill
Learn More
{/* Referral Bonus Offer */}
Referral Program
Refer & Earn
Get $20 credit for each new customer referral
Invite Friends
{/* Loyalty Program Card */}
EP Rewards Program
Earn points with every payment
700 points
1000 points for next reward
{/* Quick Actions */}
{/* Special Benefits Section */}
}
title="Protected Rate"
description="Lock in your current rate for 6 months"
/>
}
title="Bundle Discount"
description="Save 15% with our service bundle"
/>
}
title="Peak Hours Savings"
description="50% off during off-peak hours"
/>
}
title="Welcome Bonus"
description="$30 credit for new customers"
/>
{/* Recent Transactions and Alerts remain the same */}
Usage Alert
Your usage is 15% higher than last month. Click here for energy-saving tips.
);
const PaymentView = () => (
Payment History
{/* Add payment history items here */}
);
const UsageView = () => (
Usage History
Download Report
{/* Add usage graph here */}
{/* Placeholder for usage graph */}
Last 7 Days
Total: 245 kWh
);
const AccountView = () => (
John Doe
Account #: EP-12345
}
title="Account Settings"
subtitle="Update your personal information"
/>
}
title="Notifications"
subtitle="Manage your notification preferences"
/>
}
title="Help & Support"
subtitle="Get help with your account"
/>
}
title="Sign Out"
subtitle="Log out of your account"
/>
);
const TransactionItem = ({ date, amount, type, status }) => (
{amount}
{status === 'success' ? 'Successful' : 'Failed'}
);
const AccountMenuItem = ({ icon, title, subtitle }) => (
);
// Benefits Card Component
const BenefitCard = ({ icon, title, description }) => (
{React.cloneElement(icon, { className: "h-5 w-5 text-gray-600" })}
{title}
{description}
);
// Promotion Card Component
const PromotionCard = ({ title, description, validUntil, discount, bgColor }) => (
{title}
{description}
Valid until: {validUntil}
{discount}
Claim Offer
);
// Promotions Page Component
const PromotionsPage = () => (
);