import React from "react"; export interface SrcProps { src: string; width?: number; height?: number; } export interface PlaceholderProps { height: number; width: number; } export type Props = SrcProps | PlaceholderProps; /** * A responsive image (or placeholder). * * Renders a single `` tag with responsive styles applied. When `src` is * not provided, a placeholder image of the correct size is rendered. */ export class ResponsiveImage extends React.Component { public render() { const { props } = this; const src = "src" in props ? props.src : emptySvgUri(props.width, props.height); return ; } } /** * Creates an SVG string with a specific width/height. */ const emptySvgUri = (width: number, height: number) => `data:image/svg+xml;utf8,`;