@wener/console
Version:
Base console UI toolkit
32 lines (31 loc) • 1.14 kB
JavaScript
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _object_destructuring_empty(o) {
if (o === null || o === void 0)
throw new TypeError("Cannot destructure " + o);
return o;
}
import React from "react";
import { MacOSWindowFrame } from "./macos/MacOSWindowFrame.js";
import { useWindowTheme } from "./useWindowTheme.js";
import { WindowsWindowFrame } from "./windows/WindowsWindowFrame.js";
export var WindowFrame = function (_0) {
var ref = _object_destructuring_empty(_0), props = _extends({}, _0);
var theme = useWindowTheme();
if (theme === "macos") {
return /*#__PURE__*/ React.createElement(MacOSWindowFrame, props);
}
return /*#__PURE__*/ React.createElement(WindowsWindowFrame, props);
};