1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 16:16:21 -04:00
jarv.is/components/TweetEmbed/TweetEmbed.tsx

27 lines
546 B
TypeScript

import { TwitterTweetEmbed } from "react-twitter-embed";
import { useTheme } from "../../hooks/use-theme";
export type TweetEmbedProps = {
id: string;
options?: object;
className?: string;
};
const TweetEmbed = ({ id, options }: TweetEmbedProps) => {
const { resolvedTheme } = useTheme();
return (
<TwitterTweetEmbed
tweetId={id}
options={{
dnt: true,
align: "center",
theme: resolvedTheme === "dark" ? "dark" : "light",
...options,
}}
/>
);
};
export default TweetEmbed;