mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 05:18:28 -04:00
27 lines
547 B
TypeScript
27 lines
547 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 { activeTheme } = useTheme();
|
|
|
|
return (
|
|
<TwitterTweetEmbed
|
|
tweetId={id}
|
|
options={{
|
|
dnt: true,
|
|
align: "center",
|
|
theme: activeTheme === "dark" ? activeTheme : "light",
|
|
...options,
|
|
}}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default TweetEmbed;
|