|
|
|
@ -7,9 +7,8 @@ import React from 'react'
|
|
|
|
import { useChatContext } from '@/app/components/base/chat/chat/context'
|
|
|
|
import { useChatContext } from '@/app/components/base/chat/chat/context'
|
|
|
|
|
|
|
|
|
|
|
|
const Link = ({ node, children, ...props }: any) => {
|
|
|
|
const Link = ({ node, children, ...props }: any) => {
|
|
|
|
|
|
|
|
const { onSend } = useChatContext()
|
|
|
|
if (node.properties?.href && node.properties.href?.toString().startsWith('abbr')) {
|
|
|
|
if (node.properties?.href && node.properties.href?.toString().startsWith('abbr')) {
|
|
|
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
|
|
|
|
|
|
const { onSend } = useChatContext()
|
|
|
|
|
|
|
|
const hidden_text = decodeURIComponent(node.properties.href.toString().split('abbr:')[1])
|
|
|
|
const hidden_text = decodeURIComponent(node.properties.href.toString().split('abbr:')[1])
|
|
|
|
|
|
|
|
|
|
|
|
return <abbr className="cursor-pointer underline !decoration-primary-700 decoration-dashed" onClick={() => onSend?.(hidden_text)} title={node.children[0]?.value || ''}>{node.children[0]?.value || ''}</abbr>
|
|
|
|
return <abbr className="cursor-pointer underline !decoration-primary-700 decoration-dashed" onClick={() => onSend?.(hidden_text)} title={node.children[0]?.value || ''}>{node.children[0]?.value || ''}</abbr>
|
|
|
|
|