UNPKG

@nwebui/react-niagara-px

Version:
22 lines 813 B
import React, { useRef } from "react"; import { color } from "./utils"; import { Widget } from "./Widget"; const CanvasPane = function ({ nativeWidget, children }) { const divRef = useRef(null); const viewSize = nativeWidget.gets("viewSize"); const [width, height] = viewSize.split(",").map((x) => x + "px"); const fg = nativeWidget.gets("foreground") || undefined; const bg = nativeWidget.gets("background") || undefined; const style = { position: "relative", left: 0, top: 0, width, height, color: color(fg), // background, }; return (React.createElement(Widget, { ref: divRef, nativeWidget: nativeWidget, style: style }, children)); }; export default CanvasPane; //# sourceMappingURL=CanvasPane.js.map