feat: highlight (#346)

This commit is contained in:
Cody Tseng 2025-05-22 22:39:13 +08:00 committed by GitHub
parent ef0dc9e923
commit 6c91ba9eff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 197 additions and 29 deletions

View file

@ -16,10 +16,12 @@ import Emoji from '../Emoji'
export default function ContentPreview({
event,
className
className,
onClick
}: {
event?: Event
className?: string
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined
}) {
const { t } = useTranslation()
const nodes = useMemo(() => {
@ -37,7 +39,7 @@ export default function ContentPreview({
const emojiInfos = extractEmojiInfosFromTags(event?.tags)
return (
<div className={cn('pointer-events-none', className)}>
<div className={cn('pointer-events-none', className)} onClick={onClick}>
{nodes.map((node, index) => {
if (node.type === 'text') {
return node.data