24 lines
752 B
TypeScript
24 lines
752 B
TypeScript
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' : pubkey ? 'Public key accessible' : 'Repository Git'
|
|
|
|
return (
|
|
<a
|
|
href="https://git.4nkweb.com/4nk/story-research-zapwall"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
className={`ml-2 text-xl ${color} hover:opacity-80 transition-opacity cursor-pointer`}
|
|
title={title}
|
|
onClick={(e) => e.stopPropagation()}
|
|
>
|
|
🔑
|
|
</a>
|
|
)
|
|
}
|