feat: add kind:1111 events to feed

This commit is contained in:
codytseng
2025-05-24 16:53:14 +08:00
parent 06f9ea984f
commit 7552499a76
5 changed files with 52 additions and 32 deletions

View File

@@ -1,12 +1,8 @@
import { Button } from '@/components/ui/button'
import { Separator } from '@/components/ui/separator'
import { getSharableEventId } from '@/lib/event'
import { cn } from '@/lib/utils'
import { Check, Copy } from 'lucide-react'
import { Event } from 'nostr-tools'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { FormattedTimestamp } from '../FormattedTimestamp'
import { UnknownNote } from '../Note/UnknownNote'
import UserAvatar from '../UserAvatar'
import Username from '../Username'
import RepostDescription from './RepostDescription'
@@ -22,9 +18,6 @@ export default function UnknownNoteCard({
embedded?: boolean
reposter?: string
}) {
const { t } = useTranslation()
const [isCopied, setIsCopied] = useState(false)
return (
<div className={className}>
<div className={cn(embedded ? 'p-2 sm:p-3 border rounded-lg' : 'px-4 py-3')}>
@@ -44,20 +37,7 @@ export default function UnknownNoteCard({
</div>
</div>
</div>
<div className="flex flex-col gap-2 items-center text-muted-foreground font-medium my-4">
<div>{t('Cannot handle event of kind k', { k: event.kind })}</div>
<Button
onClick={(e) => {
e.stopPropagation()
navigator.clipboard.writeText(getSharableEventId(event))
setIsCopied(true)
setTimeout(() => setIsCopied(false), 2000)
}}
variant="outline"
>
{isCopied ? <Check /> : <Copy />} Copy event ID
</Button>
</div>
<UnknownNote event={event} />
</div>
{!embedded && <Separator />}
</div>