feat: remove tweet embeding

This commit is contained in:
DIYgod
2023-10-07 17:58:36 +08:00
parent 73e7b10340
commit 7fcb61fd5f
5 changed files with 0 additions and 73 deletions
-24
View File
@@ -1,24 +0,0 @@
import dynamic from "next/dynamic"
import Image from "next/image"
import type { TwitterComponents } from "react-tweet"
import { SITE_URL } from "~/lib/env"
const ReactTweet = dynamic(async () => (await import("react-tweet")).Tweet)
const components: TwitterComponents = {
AvatarImg: (props) => <Image {...props} alt="avatar" />,
MediaImg: (props) => <Image {...props} fill unoptimized alt="tweet-media" />,
}
export default function Tweet({ id }: { id: string }) {
return (
<div className="flex justify-center">
<ReactTweet
id={id}
components={components}
apiUrl={`${SITE_URL}/api/tweet?id=${id}`}
/>
</div>
)
}