feat: explore

This commit is contained in:
codytseng
2025-09-07 22:23:01 +08:00
parent f2bb65acf0
commit ace4e94071
11 changed files with 240 additions and 233 deletions

View File

@@ -1,6 +1,6 @@
import { usePrimaryPage } from '@/PageManager'
import relayInfoService from '@/services/relay-info.service'
import { TNip66RelayInfo } from '@/types'
import { TRelayInfo } from '@/types'
import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import RelaySimpleInfo, { RelaySimpleInfoSkeleton } from '../RelaySimpleInfo'
@@ -10,7 +10,7 @@ export default function RelayList() {
const { t } = useTranslation()
const { navigate } = usePrimaryPage()
const [loading, setLoading] = useState(true)
const [relays, setRelays] = useState<TNip66RelayInfo[]>([])
const [relays, setRelays] = useState<TRelayInfo[]>([])
const [showCount, setShowCount] = useState(20)
const [input, setInput] = useState('')
const [debouncedInput, setDebouncedInput] = useState(input)
@@ -82,7 +82,7 @@ export default function RelayList() {
/>
))}
{showCount < relays.length && <div ref={bottomRef} />}
{loading && <RelaySimpleInfoSkeleton />}
{loading && <RelaySimpleInfoSkeleton className="p-4" />}
{!loading && relays.length === 0 && (
<div className="text-center text-muted-foreground text-sm">{t('no relays found')}</div>
)}