feat: highlight (#346)
This commit is contained in:
parent
ef0dc9e923
commit
6c91ba9eff
8 changed files with 197 additions and 29 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue