Files
Max LeiterandGitHub 4c3b7f9b7a Export RedirectType from next/navigation (#54729)
A continuation of #51864 with RedirectType used in an e2e test and some
ts-ignores removed from the codebase. Happy to split it into two PRs but
I left comments in the two consequential files

---------
2023-08-29 11:05:44 -07:00

31 lines
787 B
TypeScript

import type { ReactNode } from 'react'
import { Tweet as ReactTweet, TweetComponents } from 'react-tweet'
import Image from 'next/image'
import { Caption } from './caption'
const components: TweetComponents = {
AvatarImg: (props) => <Image {...props} />,
MediaImg: (props) => <Image {...props} fill unoptimized />,
}
// we import this globally in the top-most layout.tsx file
// until Next.js lands suspense-y CSS support
// import "./tweet.css";
interface TweetArgs {
id: string
caption: ReactNode
}
export async function Tweet({ id, caption }: TweetArgs) {
return (
<div className="my-6">
<div className="flex justify-center">
<ReactTweet id={id} components={components} />
</div>
{caption && <Caption>{caption}</Caption>}
</div>
)
}