Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
at main 23 lines 669 B view raw
1import getURLs from "@hey/helpers/getURLs"; 2import { memo } from "react"; 3import Oembed from "@/components/Shared/Post/Oembed"; 4import { usePostAttachmentStore } from "@/store/non-persisted/post/usePostAttachmentStore"; 5import { usePostStore } from "@/store/non-persisted/post/usePostStore"; 6 7const LinkPreviews = () => { 8 const { postContent, quotedPost } = usePostStore(); 9 const { attachments } = usePostAttachmentStore(); 10 const urls = getURLs(postContent); 11 12 if (!urls.length || attachments.length || quotedPost) { 13 return null; 14 } 15 16 return ( 17 <div className="m-5"> 18 <Oembed url={urls[0]} /> 19 </div> 20 ); 21}; 22 23export default memo(LinkPreviews);