-
-
Current Database Statistics
+
+ Current Database Statistics
-
{stats?.vips || 0}
-
VIPs
+
{stats?.vips || 0}
+
VIPs
-
{stats?.drivers || 0}
-
Drivers
+
{stats?.drivers || 0}
+
Drivers
-
{stats?.vehicles || 0}
-
Vehicles
+
{stats?.vehicles || 0}
+
Vehicles
-
{stats?.events || 0}
-
Events
+
{stats?.events || 0}
+
Events
-
{stats?.flights || 0}
-
Flights
+
{stats?.flights || 0}
+
Flights
-
{stats?.users || 0}
-
Users
+
{stats?.users || 0}
+
Users
+
+
+
+
Signal Messaging
+
+
+
+
+ {/* Connection Status */}
+
+
+
+ {signalLoading ? (
+
+ ) : signalStatus?.isConnected ? (
+ signalStatus?.isLinked ? (
+
+ ) : (
+
+ )
+ ) : (
+
+ )}
+
+
+ {signalLoading
+ ? 'Checking status...'
+ : signalStatus?.isConnected
+ ? signalStatus?.isLinked
+ ? 'Connected & Linked'
+ : 'API Connected - Not Linked'
+ : 'Not Connected'}
+
+ {signalStatus?.phoneNumber && (
+
+
+ {signalStatus.phoneNumber}
+
+ )}
+ {signalStatus?.error && (
+
{signalStatus.error}
+ )}
+
+
+
+ {signalStatus?.isLinked && (
+
+ )}
+
+
+
+ {/* Link Account Section */}
+ {signalStatus?.isConnected && !signalStatus?.isLinked && (
+
+
+ Link your Signal account to send messages to drivers. You can either scan a QR code with your phone or register a phone number.
+
+
+
+
+
+
+
+
+ )}
+
+ {/* QR Code Display */}
+ {showQRCode && qrCodeData && (
+
+
Scan with Signal App
+
+

+
+
+ Open Signal on your phone → Settings → Linked Devices → Link New Device
+
+
+
+ )}
+
+ {/* Register Phone Number */}
+ {showRegister && (
+
+
Register Phone Number
+
+ setRegisterPhone(e.target.value)}
+ placeholder="+1234567890"
+ className="flex-1 px-3 py-2 bg-background text-foreground border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-primary"
+ />
+
+
+
+
+ )}
+
+ {/* Verify Code */}
+ {showVerify && (
+
+
Enter Verification Code
+
+ A verification code was sent to {registerPhone}
+
+
+ setVerifyCode(e.target.value)}
+ placeholder="123456"
+ className="flex-1 px-3 py-2 bg-background text-foreground border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-primary"
+ />
+
+
+
+
+ )}
+
+ {/* Test Message (when linked) */}
+ {signalStatus?.isLinked && (
+
+
Send Test Message
+
+ setTestRecipient(e.target.value)}
+ placeholder="Recipient phone number (+1234567890)"
+ className="w-full px-3 py-2 bg-background text-foreground border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-primary"
+ />
+
+
+ )}
+
+ {/* Chat Management (when linked) */}
+ {signalStatus?.isLinked && (
+
+
Chat History Management
+
+ {/* Stats */}
+ {messageStats && (
+
+
+
{messageStats.total}
+
Total Messages
+
+
+
{messageStats.inbound}
+
Received
+
+
+
{messageStats.outbound}
+
Sent
+
+
+
{messageStats.unread}
+
Unread
+
+
+
{messageStats.driversWithMessages}
+
Drivers
+
+
+ )}
+
+
+
+
+
+
+
+ )}
+
+ {/* Not Connected Message */}
+ {!signalStatus?.isConnected && !signalLoading && (
+
+
+
+ Signal API is not running. Start the signal-api container:
+
+
+ docker-compose up -d signal-api
+
+
+ )}
+