fix: 🐛

This commit is contained in:
codytseng
2025-06-25 11:01:53 +08:00
parent cb32439896
commit 6c2cd0ff42
7 changed files with 131 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ import { Skeleton } from '@/components/ui/skeleton'
import { ExtendedKind } from '@/constants'
import { useFetchEvent } from '@/hooks'
import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
import { getParentEventId, getRootEventId, isPictureEvent } from '@/lib/event'
import { getParentEventId, getRootEventId, isPictureEvent, isSupportedKind } from '@/lib/event'
import { toNote, toNoteList } from '@/lib/link'
import { tagNameEquals } from '@/lib/tag'
import { useMuteList } from '@/providers/MuteListProvider'
@@ -158,6 +158,21 @@ function ParentNote({ eventId }: { eventId?: string }) {
)
}
if (!isSupportedKind(event.kind)) {
return (
<div>
<Card
className="flex space-x-1 p-1 items-center clickable text-sm text-muted-foreground hover:text-foreground"
onClick={() => push(toNote(eventId))}
>
<UserAvatar userId={event.pubkey} size="tiny" className="shrink-0" />
<div className="shrink-0">[{t('Cannot handle event of kind k', { k: event.kind })}]</div>
</Card>
<div className="ml-5 w-px h-2 bg-border" />
</div>
)
}
return (
<div>
<Card