import React from 'react';
import styled from 'styled-components';
interface StyleProps {
backgroundColor: string;
minHeight: string;
src: string;
}
interface VideoProps {}
interface Props {
backgroundColor: string;
children: React.ReactNode;
minHeight: string;
mp4: string;
src: string;
theme: string;
webm: string;
}
const CoverBackground = ({ backgroundColor, children, minHeight, mp4, src, theme, webm }: Props) => {
return (
{(webm || mp4) && (
)}
{children}
);
};
export default CoverBackground;
/* styles */
const Cover = styled.div`
background-image: ${({ src }) => `url(${src})`};
background-color: ${({ backgroundColor }) => backgroundColor};
background-size: cover;
background-repeat: no-repeat;
background-position: center;
overflow: hidden;
position: relative;
min-height: ${({ minHeight }) => minHeight};
`;
const CoverVideo = styled.video`
position: absolute;
left: 0;
top: 0;
height: 100%;
min-width: 100%;
`;