22 lines
572 B
TypeScript
22 lines
572 B
TypeScript
import { useNostrAuth } from '@/hooks/useNostrAuth'
|
|
|
|
export function KeyIndicator() {
|
|
const { pubkey, isUnlocked } = useNostrAuth()
|
|
|
|
// No indicator if no account
|
|
if (!pubkey) {
|
|
return null
|
|
}
|
|
|
|
// 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' : 'Public key accessible'
|
|
|
|
return (
|
|
<span className={`ml-2 text-xl ${color}`} title={title}>
|
|
🔑
|
|
</span>
|
|
)
|
|
}
|