feat: Link preview (#73)

This commit is contained in:
kunigaku
2023-11-25 19:15:25 +09:00
committed by GitHub
parent 22ee2420e6
commit ef8b85933d
6 changed files with 191 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import MentionedUserDisplay from '@/components/event/textNote/MentionedUserDispl
import VideoDisplay from '@/components/event/textNote/VideoDisplay';
import EventLink from '@/components/EventLink';
import SafeLink from '@/components/utils/SafeLink';
import PreviewedLink from '@/components/utils/PreviewedLink';
import { createSearchColumn } from '@/core/column';
import useConfig from '@/core/useConfig';
import { useRequestCommand } from '@/hooks/useCommandBus';
@@ -51,7 +52,7 @@ const TextNoteContentDisplay = (props: TextNoteContentDisplayProps) => {
if (isVideoUrl(item.content)) {
return <VideoDisplay url={item.content} initialHidden={initialHidden()} />;
}
return <SafeLink class="text-blue-500 underline" href={item.content} />;
return <PreviewedLink class="text-blue-500 underline" href={item.content} />;
}
if (item.type === 'TagReference') {
const resolved = event().resolveTagReference(item);