import React from 'react'; import { Img } from './Img'; export interface Props { desktopSrc: string; mobileSrc: string; onLoad?(): void; onError?(): void; } export const Picture: React.FC = ({ desktopSrc, mobileSrc, onLoad, onError, }) => { if (!mobileSrc && desktopSrc) { return ( ); } if (mobileSrc && !desktopSrc) { return ( ); } if (mobileSrc && desktopSrc) { return ( ); } return null; };