import { Suspense } from "react"; import Image from "next/image"; import { EmbeddedTweet, TweetSkeleton, TweetNotFound } from "react-tweet"; import { getTweet } from "react-tweet/api"; import clsx from "clsx"; import type { ComponentPropsWithoutRef } from "react"; import styles from "./Tweet.module.css"; export type TweetProps = Omit, "tweet"> & { id: string; className?: string; }; const Tweet = async ({ id, className, ...rest }: TweetProps) => { try { const tweet = await getTweet(id); return (
}> {tweet ? ( , // eslint-disable-next-line jsx-a11y/alt-text MediaImg: (props) => , }} {...rest} /> ) : ( )}
); } catch ( error // eslint-disable-line @typescript-eslint/no-unused-vars ) { return (
); } }; export default Tweet;