2017-06-29 12:54:02 -06:00
|
|
|
import * as React from "react";
|
2019-12-26 13:20:10 -07:00
|
|
|
import { ErrorBoundary } from "../error_boundary";
|
2017-06-29 12:54:02 -06:00
|
|
|
|
|
|
|
interface WidgetProps {
|
2018-03-19 06:57:49 -06:00
|
|
|
children?: React.ReactNode;
|
2017-06-29 12:54:02 -06:00
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Widget(props: WidgetProps) {
|
2017-07-03 14:59:36 -06:00
|
|
|
let className = `widget-wrapper `;
|
|
|
|
if (props.className) { className += props.className; }
|
2017-08-28 05:44:37 -06:00
|
|
|
return <div className={className}>
|
2019-12-26 13:20:10 -07:00
|
|
|
<ErrorBoundary>
|
|
|
|
{props.children}
|
|
|
|
</ErrorBoundary>
|
2017-08-28 05:44:37 -06:00
|
|
|
</div>;
|
2017-06-29 12:54:02 -06:00
|
|
|
}
|