import React from "react"; import { color, ColorInput } from "./color.js"; export interface WindowProps { decorations: boolean; paddingY: number; paddingX: number; width: number; height: number; background: ColorInput; children?: React.ReactNode; } export const Window: React.FunctionComponent = props => { const paddingTop = props.decorations ? props.paddingY + 40 : props.paddingY; const paddingBottom = props.decorations ? props.paddingY + 20 : props.paddingY; const paddingX = props.decorations ? props.paddingX + 20 : props.paddingX; const width = props.width * 10 + paddingX * 2; const height = props.height * 10 + paddingTop + paddingBottom; return ( {props.decorations && ( )} {props.children} ); };