diff --git a/frontend/src/pages/Customers.jsx b/frontend/src/pages/Customers.jsx index 09cd29d..370e8fc 100644 --- a/frontend/src/pages/Customers.jsx +++ b/frontend/src/pages/Customers.jsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import api from '../api/client' import { copyToClipboard } from '../utils/clipboard' -import { Plus, Trash2, Edit2, X, Check, ChevronDown, ChevronRight, Copy, Key } from 'lucide-react' +import { Plus, Trash2, Edit2, X, Check, ChevronDown, ChevronRight, Copy, Key, Monitor } from 'lucide-react' const PERM_LABELS = { agent: { label: 'Agent', color: 'text-blue-400 bg-blue-900/30 border-blue-700/50' }, @@ -198,10 +198,12 @@ export default function Customers() { function CustomerKeyPanel({ customerId }) { const [keys, setKeys] = useState(null) + const [agents, setAgents] = useState(null) const [copied, setCopied] = useState(null) useEffect(() => { api.getCustomerAPIKeys(customerId).then(setKeys) + api.getCustomerAgents(customerId).then(setAgents) }, [customerId]) const copyKey = (key, id) => { @@ -210,49 +212,74 @@ function CustomerKeyPanel({ customerId }) { setTimeout(() => setCopied(null), 2000) } - if (keys === null) { + const loading = keys === null || agents === null + if (loading) { return
- {k.key.substring(0, 8)}...{k.key.substring(k.key.length - 4)}
-
-
-
+ {k.key.substring(0, 8)}...{k.key.substring(k.key.length - 4)}
+
+
+