Add variant prop to VideoPlayer component
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
interface Props {
|
interface Props {
|
||||||
src: string;
|
src: string;
|
||||||
|
variant?: 'compact' | 'wide';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function VideoPlayer({ src }: Props) {
|
export default function VideoPlayer({ src, variant = 'wide' }: Props) {
|
||||||
if (!src) return null;
|
if (!src) return null;
|
||||||
|
const className = variant === 'compact' ? 'video-shell compact' : 'video-shell';
|
||||||
return (
|
return (
|
||||||
<div className="video-shell">
|
<div className={className}>
|
||||||
<video controls src={src} preload="metadata" />
|
<video controls src={src} preload="metadata" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user