react-bluesky-embed
Version:
React Bluesky Embed allows you to embed post threads, profiles, and comments in your React application when using Next.js, Create React App, Vite, and more.
1 lines • 707 B
JavaScript
"use client";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{EmbeddedPostThread,PostThreadNotFound,PostThreadSkeleton}from"./bluesky-theme/components.js";import{usePostThread}from"./hooks.js";export const PostThread=({params,theme="light",fallback=/*#__PURE__*/_jsx(PostThreadSkeleton,{theme:theme}),config,onError,hidePost})=>{const{data,error,isLoading}=usePostThread(params,config);if(isLoading)return fallback;if(error||!data){const NotFound=PostThreadNotFound;return /*#__PURE__*/_jsx(NotFound,{theme:theme,error:onError?onError(error):error})}return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(EmbeddedPostThread,{theme:theme,postThread:data,hidePost:hidePost})})};