1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-14 13:24:25 -04:00

all components should accept additional classnames

This commit is contained in:
2022-01-20 12:06:05 -05:00
parent 2162e9d563
commit 7e37adabc1
22 changed files with 150 additions and 86 deletions

View File

@@ -1,19 +1,22 @@
import classNames from "classnames";
import ReactPlayer from "react-player/youtube";
import styles from "./YouTubeEmbed.module.css";
type Props = {
id: string;
className?: string;
};
const YouTubeEmbed = ({ id }: Props) => (
<div className={styles.wrapper}>
const YouTubeEmbed = ({ id, className, ...rest }: Props) => (
<div className={classNames(styles.wrapper, className)}>
<ReactPlayer
width="100%"
height="100%"
url={`https://www.youtube-nocookie.com/watch?v=${id}`}
light={`https://i.ytimg.com/vi/${id}/hqdefault.jpg`}
controls
{...rest}
/>
</div>
);