diff --git a/src/components/ui/APlayer.tsx b/src/components/ui/APlayer.tsx index 3fcffd6c..65ef409d 100644 --- a/src/components/ui/APlayer.tsx +++ b/src/components/ui/APlayer.tsx @@ -1,12 +1,11 @@ "use client" -import { APlayer as AplayerReact } from "aplayer-react" import "aplayer-react/dist/index.css" import { memo } from "react" import { toGateway } from "~/lib/ipfs-parser" -const APlayer = memo(function APlayer({ +const APlayer = memo(async function APlayer({ src, name, artist, @@ -31,6 +30,8 @@ const APlayer = memo(function APlayer({ name = name.replace(/^user-content-/, "") } + const { APlayer: AplayerReact } = await import("aplayer-react") + return ( diff --git a/src/components/ui/GithubRepo.tsx b/src/components/ui/GithubRepo.tsx index 399d72fc..15bd1a75 100644 --- a/src/components/ui/GithubRepo.tsx +++ b/src/components/ui/GithubRepo.tsx @@ -1,5 +1,5 @@ -import { GithubRepo as ReactGithubRepo } from "@birdgg/react-github" +export default async function GithubRepo({ repo }: { repo: string }) { + const { GithubRepo: ReactGithubRepo } = await import("@birdgg/react-github") -export default function GithubRepo({ repo }: { repo: string }) { return } diff --git a/src/components/ui/Tweet.tsx b/src/components/ui/Tweet.tsx index 1a56112c..bc1d47e9 100644 --- a/src/components/ui/Tweet.tsx +++ b/src/components/ui/Tweet.tsx @@ -1,5 +1,4 @@ import Image from "next/image" -import { Tweet as ReactTweet } from "react-tweet" import type { TweetComponents } from "react-tweet" const components: TweetComponents = { @@ -7,7 +6,9 @@ const components: TweetComponents = { MediaImg: (props) => tweet-media, } -export default function Tweet({ id }: { id: string }) { +export default async function Tweet({ id }: { id: string }) { + const { Tweet: ReactTweet } = await import("react-tweet") + return (