feat: explore (#85)

This commit is contained in:
Cody Tseng
2025-02-11 16:33:31 +08:00
committed by GitHub
parent 80893ec033
commit b91f46723e
35 changed files with 811 additions and 179 deletions

View File

@@ -8,7 +8,7 @@ export default function RelayIcon({
className = 'w-6 h-6',
iconSize = 14
}: {
url: string
url?: string
className?: string
iconSize?: number
}) {
@@ -17,13 +17,14 @@ export default function RelayIcon({
if (relayInfo?.icon) {
return relayInfo.icon
}
if (!url) return
const u = new URL(url)
return `${u.protocol === 'wss:' ? 'https:' : 'http:'}//${u.host}/favicon.ico`
}, [url, relayInfo])
return (
<Avatar className={className}>
<AvatarImage src={iconUrl} />
<AvatarImage src={iconUrl} className="object-cover object-center" />
<AvatarFallback>
<Server size={iconSize} />
</AvatarFallback>