re-add link preview
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { useOpenGraph } from '@utils/hooks/useOpenGraph';
|
||||
@@ -20,11 +22,11 @@ export function LinkPreview({ urls }: { urls: string[] }) {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<a
|
||||
className="flex flex-col rounded-lg"
|
||||
href={urls[0]}
|
||||
<Link
|
||||
to={urls[0]}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="flex flex-col rounded-lg"
|
||||
>
|
||||
{error ? (
|
||||
<div className="flex flex-col gap-2 px-3 py-3">
|
||||
@@ -42,22 +44,22 @@ export function LinkPreview({ urls }: { urls: string[] }) {
|
||||
className="h-44 w-full rounded-t-lg object-cover"
|
||||
/>
|
||||
)}
|
||||
<div className="flex flex-col gap-2 px-3 py-3">
|
||||
<h5 className="line-clamp-1 font-medium leading-none text-white">
|
||||
<div className="flex flex-col gap-1 border-t border-white/5 px-3 py-3">
|
||||
<h5 className="line-clamp-1 font-semibold leading-none text-white">
|
||||
{data.title}
|
||||
</h5>
|
||||
{data.description && (
|
||||
<p className="line-clamp-3 break-all text-sm text-white/50">
|
||||
<p className="line-clamp-3 break-words text-sm text-white/50">
|
||||
{data.description}
|
||||
</p>
|
||||
)}
|
||||
<span className="mt-2.5 text-sm leading-none text-white/50">
|
||||
<span className="mt-2.5 text-sm leading-none text-white/80">
|
||||
{domain.hostname}
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</a>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user