refactor: 💨

This commit is contained in:
codytseng
2025-07-07 22:34:59 +08:00
parent c729c20771
commit 8c5cc1041b
46 changed files with 1008 additions and 879 deletions

View File

@@ -0,0 +1,24 @@
import { getGroupMetadata } from '@/lib/event'
import { cn } from '@/lib/utils'
import { Event } from 'nostr-tools'
import { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
export default function GroupMetadataPreview({
event,
className,
onClick
}: {
event: Event
className?: string
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined
}) {
const { t } = useTranslation()
const metadata = useMemo(() => getGroupMetadata(event), [event])
return (
<div className={cn('pointer-events-none', className)} onClick={onClick}>
[{t('Group')}] <span className="italic">{metadata.name}</span>
</div>
)
}