import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' import { List, Globe, GitBranch, UserX, HardDrive, BarChart2, Network, Plus, Mail, KeyRound, Gauge, UserCheck, FlaskConical, Terminal, Edit, Lock, FileQuestion, FileText, ArrowLeftRight, RotateCcw, Trash2, TrendingDown, ArrowUpDown, Code2, Copy, Layers } from 'lucide-react' import { api } from '../api/client' interface Stats { total: number active: number suspended: number terminated: number } interface FunctionCard { icon: React.ComponentType<{ size?: number | string; className?: string }> label: string description: string path: string soon?: boolean } const accountInfo: FunctionCard[] = [ { icon: List, label: 'List Accounts', description: 'View and manage all hosting accounts', path: '/accounts/list' }, { icon: Globe, label: 'List Parked Domains', description: 'View all parked domains across accounts', path: '/accounts/parked-domains' }, { icon: GitBranch, label: 'List Subdomains', description: 'View all subdomains across accounts', path: '/accounts/subdomains' }, { icon: UserX, label: 'List Suspended Accounts', description: 'View and manage suspended accounts', path: '/accounts/suspended' }, { icon: HardDrive, label: 'Show Accounts Over Quota', description: 'Accounts that have exceeded their disk quota', path: '/accounts/over-quota' }, { icon: BarChart2, label: 'View Bandwidth Usage', description: 'Bandwidth consumption sorted by usage', path: '/accounts/bandwidth' }, ] const accountFunctions: FunctionCard[] = [ { icon: Network, label: 'Change Site\'s IP Address', description: 'Assign a different IP to an account', path: '/accounts/change-ip' }, { icon: Plus, label: 'Create a New Account', description: 'Create a new hosting account', path: '/accounts/create' }, { icon: Mail, label: 'Email All Users', description: 'Send a bulk email to all account holders', path: '/accounts/email-users', soon: true }, { icon: KeyRound, label: 'Force Password Change', description: 'Force users to change password on next login', path: '/accounts/force-password', soon: true }, { icon: Gauge, label: 'Limit Bandwidth Usage', description: 'Set per-account bandwidth caps independent of package', path: '/accounts/limit-bandwidth', soon: true }, { icon: UserCheck, label: 'Manage Account Suspension', description: 'Suspend or unsuspend a hosting account', path: '/accounts/suspension' }, { icon: FlaskConical, label: 'Manage Demo Mode', description: 'Put accounts into read-only demo mode', path: '/accounts/demo-mode', soon: true }, { icon: Terminal, label: 'Manage Shell Access', description: 'Grant or revoke SSH shell access', path: '/accounts/shell-access' }, { icon: Edit, label: 'Modify an Account', description: 'Edit account email, notes, or package', path: '/accounts/modify' }, { icon: Lock, label: 'Password Modification', description: 'Change the password for a hosting account', path: '/accounts/password' }, { icon: FileQuestion, label: 'Quota Modification', description: 'Adjust disk and bandwidth quotas', path: '/accounts/quota' }, { icon: FileText, label: 'Apache Log Viewer', description: 'View Apache access and error logs per account', path: '/accounts/apache-logs' }, { icon: ArrowLeftRight,label: 'Rearrange an Account', description: 'Move an account between resellers', path: '/accounts/rearrange', soon: true }, { icon: RotateCcw, label: 'Reset Account Bandwidth', description: 'Reset bandwidth counters for accounts', path: '/accounts/reset-bandwidth' }, { icon: Trash2, label: 'Terminate Accounts', description: 'Permanently terminate a hosting account', path: '/accounts/terminate' }, { icon: TrendingDown, label: 'Unsuspend Bandwidth Exceeders',description: 'Unsuspend accounts suspended for bandwidth', path: '/accounts/unsuspend-bandwidth' }, { icon: ArrowUpDown, label: 'Upgrade / Downgrade an Account',description: 'Change the hosting package for an account', path: '/accounts/upgrade' }, { icon: Code2, label: 'Web Template Editor', description: 'Edit default HTML templates for new accounts', path: '/accounts/web-template', soon: true }, ] const multiAccountFunctions: FunctionCard[] = [ { icon: Copy, label: 'Change Multiple Sites\' IP Addresses', description: 'Batch-change IP addresses across multiple accounts', path: '/accounts/bulk-ip', soon: true }, { icon: Layers, label: 'Modify / Upgrade Multiple Accounts', description: 'Apply changes to multiple accounts simultaneously', path: '/accounts/bulk-modify', soon: true }, ] interface CategoryProps { title: string color: string headerBg: string cards: FunctionCard[] } function Category({ title, color, headerBg, cards }: CategoryProps) { const navigate = useNavigate() return (
Manage hosting accounts, domains, and usage.
{s.label}
{s.value}