2026-01-06 00:59:38 +01:00

23 lines
709 B
TypeScript

import Link from 'next/link'
import { useNostrAuth } from '@/hooks/useNostrAuth'
export function KeyIndicator() {
const { pubkey, isUnlocked } = useNostrAuth()
// Red if private key is accessible (unlocked)
// Green if only public key is accessible (connected but not unlocked)
const color = isUnlocked ? 'text-red-500' : 'text-green-500'
const title = isUnlocked ? 'Private key accessible (Settings)' : pubkey ? 'Public key accessible (Settings)' : 'Settings'
return (
<Link
href="/settings"
className={`ml-2 text-xl ${color} hover:opacity-80 transition-opacity cursor-pointer`}
title={title}
onClick={(e) => e.stopPropagation()}
>
🔑
</Link>
)
}