UNPKG

@skbkontur/cassandra-distributed-task-queue-ui

Version:

.NET library implementing distributed task queue machinery using Apache Cassandra

35 lines 3.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CommonLayout = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const ArrowALeftIcon24Regular_1 = require("@skbkontur/icons/ArrowALeftIcon24Regular"); const react_stack_layout_1 = require("@skbkontur/react-stack-layout"); const react_ui_1 = require("@skbkontur/react-ui"); const react_1 = tslib_1.__importDefault(require("react")); const RouterLink_1 = require("../RouterLink/RouterLink"); const CommonLayout_styles_1 = require("./CommonLayout.styles"); function CommonLayout(_a) { var { children, topRightTools, withArrow } = _a, restProps = tslib_1.__rest(_a, ["children", "topRightTools", "withArrow"]); const theme = react_1.default.useContext(react_ui_1.ThemeContext); return (jsx_runtime_1.jsxs("div", Object.assign({ className: `${CommonLayout_styles_1.jsStyles.commonLayout(theme)} ${withArrow ? CommonLayout_styles_1.jsStyles.withArrow() : ""}` }, restProps, { children: [topRightTools && jsx_runtime_1.jsx("div", Object.assign({ className: CommonLayout_styles_1.jsStyles.topRightTools() }, { children: topRightTools }), void 0), children] }), void 0)); } exports.CommonLayout = CommonLayout; CommonLayout.Content = function Content(_a) { var { children } = _a, restProps = tslib_1.__rest(_a, ["children"]); return (jsx_runtime_1.jsx("div", Object.assign({ className: CommonLayout_styles_1.jsStyles.content() }, restProps, { children: children }), void 0)); }; CommonLayout.Header = function Header(_a) { var { title, tools, children, borderBottom } = _a, restProps = tslib_1.__rest(_a, ["title", "tools", "children", "borderBottom"]); const theme = react_1.default.useContext(react_ui_1.ThemeContext); return (jsx_runtime_1.jsxs("div", Object.assign({ className: `${CommonLayout_styles_1.jsStyles.header()} ${borderBottom ? CommonLayout_styles_1.jsStyles.borderBottom(theme) : ""}` }, restProps, { children: [jsx_runtime_1.jsxs(react_stack_layout_1.RowStack, Object.assign({ baseline: true, block: true, gap: 2 }, { children: [jsx_runtime_1.jsx(react_stack_layout_1.Fit, { children: jsx_runtime_1.jsx("h2", Object.assign({ className: CommonLayout_styles_1.jsStyles.headerTitle(), "data-tid": "Header" }, { children: title }), void 0) }, void 0), tools && jsx_runtime_1.jsx(react_stack_layout_1.Fill, { children: tools }, void 0)] }), void 0), children && jsx_runtime_1.jsx("div", Object.assign({ className: `${CommonLayout_styles_1.jsStyles.content()} ${CommonLayout_styles_1.jsStyles.headerContent()}` }, { children: children }), void 0)] }), void 0)); }; CommonLayout.GoBack = function CommonLayoutGoBack({ to }) { const theme = react_1.default.useContext(react_ui_1.ThemeContext); return (jsx_runtime_1.jsx(RouterLink_1.RouterLink, Object.assign({ "data-tid": "GoBack", to: to, className: CommonLayout_styles_1.jsStyles.backLink() }, { children: jsx_runtime_1.jsx(ArrowALeftIcon24Regular_1.ArrowALeftIcon24Regular, { align: "none", className: CommonLayout_styles_1.jsStyles.backLinkIcon(theme) }, void 0) }), void 0)); }; CommonLayout.ContentLoader = function ContentLoader(props) { const { active, children } = props, restProps = tslib_1.__rest(props, ["active", "children"]); return (jsx_runtime_1.jsx(react_ui_1.Loader, Object.assign({ className: CommonLayout_styles_1.jsStyles.loader(), active: active, type: "big" }, restProps, { children: children }), void 0)); }; //# sourceMappingURL=CommonLayout.js.map