feat: show verified/unverified badge on site cards

This commit is contained in:
Usman Baig
2026-03-13 16:32:26 +01:00
parent 66a9ac1f31
commit 8f06c9168a
4 changed files with 26 additions and 8 deletions

View File

@@ -62,13 +62,22 @@ function SiteCard({ site, stats, statsLoading, onDelete, canDelete }: SiteCardPr
</div>
</div>
<div className="flex items-center gap-2 rounded-full bg-green-50 px-2 py-1 text-xs font-medium text-green-700 dark:bg-green-900/20 dark:text-green-400">
<span className="relative flex h-2 w-2">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-green-500"></span>
</span>
Active
</div>
{site.is_verified ? (
<div className="flex items-center gap-2 rounded-full bg-green-50 px-2 py-1 text-xs font-medium text-green-700 dark:bg-green-900/20 dark:text-green-400">
<span className="relative flex h-2 w-2">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-green-500"></span>
</span>
Active
</div>
) : (
<div className="flex items-center gap-2 rounded-full bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 dark:bg-amber-900/20 dark:text-amber-400">
<span className="relative flex h-2 w-2">
<span className="relative inline-flex rounded-full h-2 w-2 bg-amber-500"></span>
</span>
Unverified
</div>
)}
</div>
{/* Mini Stats Grid */}

View File

@@ -9,7 +9,7 @@ import {
AlertTriangleIcon,
ZapIcon
} from '@ciphera-net/ui'
import { Site } from '@/lib/api/sites'
import { Site, verifySite } from '@/lib/api/sites'
import { getRealtime } from '@/lib/api/stats'
import { toast, Button } from '@ciphera-net/ui'
@@ -56,6 +56,7 @@ export default function VerificationModal({ isOpen, onClose, site }: Verificatio
if (data.visitors > 0) {
setStatus('success')
toast.success('Connection established!')
try { await verifySite(site.id) } catch {}
}
} catch (e) {
// Ignore errors