feat: format highlight source url

This commit is contained in:
codytseng
2025-10-18 23:39:13 +08:00
parent 28dad7373f
commit bd3dc894c4
3 changed files with 37 additions and 36 deletions

View File

@@ -10,6 +10,7 @@ import { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import Content from '../Content'
import ContentPreview from '../ContentPreview'
import ExternalLink from '../ExternalLink'
import UserAvatar from '../UserAvatar'
export default function Highlight({ event, className }: { event: Event; className?: string }) {
@@ -99,15 +100,10 @@ function HighlightSource({ event }: { event: Event }) {
return (
<div className="truncate text-muted-foreground">
{t('From')}{' '}
<a
href={sourceTag[1]}
target="_blank"
rel="noopener noreferrer"
className="underline text-muted-foreground hover:text-foreground"
onClick={(e) => e.stopPropagation()}
>
{sourceTag[1]}
</a>
<ExternalLink
url={sourceTag[1]}
className="underline italic text-muted-foreground hover:text-foreground"
/>
</div>
)
}