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
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