feat(nostr): Add Nostr relay connection and status management

- Integrate nostr-tools for Nostr relay connectivity
- Create NostrClient for managing relay connections
- Implement useNostr composable for reactive connection handling
- Add ConnectionStatus component to display relay connection state
- Configure environment variable for Nostr relay endpoints
- Update App.vue to manage Nostr connection lifecycle
This commit is contained in:
padreug 2025-03-09 14:27:51 +01:00
parent 6a5b64a382
commit 2a83972b47
7 changed files with 244 additions and 2 deletions

View file

@ -0,0 +1,20 @@
<!-- A component that shows NOSTR connection status -->
<script setup lang="ts">
import { Badge } from '@/components/ui/badge'
defineProps<{
isConnected: boolean
error?: Error | null
}>()
</script>
<template>
<div class="flex items-center gap-2">
<Badge :variant="isConnected ? 'default' : 'destructive'" class="h-5">
NOSTR: {{ isConnected ? 'Connected' : 'Disconnected' }}
</Badge>
<p v-if="error" class="text-sm text-destructive">
{{ error.message }}
</p>
</div>
</template>