19 lines
436 B
TypeScript
19 lines
436 B
TypeScript
import React from 'react';
|
|
import Css from './debug-info.module.css';
|
|
|
|
export type Props = {
|
|
value?: string;
|
|
children?: any;
|
|
};
|
|
|
|
export const DebugInfo = (props: Props): JSX.Element => {
|
|
let output: any;
|
|
if (props.value) {
|
|
output = <pre>{props.value}</pre>;
|
|
} else if (props.children) {
|
|
output = props.children;
|
|
} else {
|
|
output = <pre>(none)</pre>;
|
|
}
|
|
return <div className={Css.debugInfo}>{output}</div>;
|
|
};
|