1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-04-19 06:55:30 -04:00
Files
jarv.is/components/TweetEmbed/TweetEmbed.tsx
T

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;