You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
354 B
TypeScript
15 lines
354 B
TypeScript
5 years ago
|
import * as React from 'react';
|
||
|
|
||
|
interface PropsType {
|
||
|
color: string;
|
||
|
size?: number | string;
|
||
|
style?: React.CSSProperties;
|
||
|
}
|
||
|
|
||
|
export default function ColorBox(props: PropsType) {
|
||
|
const size = props.size ?? 64;
|
||
|
const style = { ...props.style, backgroundColor: props.color, width: size, height: size };
|
||
|
return (
|
||
|
<div style={style} />
|
||
|
);
|
||
|
}
|