You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
704 B
24 lines
704 B
import { getLiveEventMetadataFromEvent } from '@/lib/event-metadata' |
|
import { cn } from '@/lib/utils' |
|
import { Event } from 'nostr-tools' |
|
import { useMemo } from 'react' |
|
import { useTranslation } from 'react-i18next' |
|
|
|
export default function LiveEventPreview({ |
|
event, |
|
className, |
|
onClick |
|
}: { |
|
event: Event |
|
className?: string |
|
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined |
|
}) { |
|
const { t } = useTranslation() |
|
const metadata = useMemo(() => getLiveEventMetadataFromEvent(event), [event]) |
|
|
|
return ( |
|
<div className={cn('pointer-events-none', className)} onClick={onClick}> |
|
[{t('Live event')}] <span className="italic pr-0.5">{metadata.title}</span> |
|
</div> |
|
) |
|
}
|
|
|