UNPKG

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

Version:

.NET library implementing distributed task queue machinery using Apache Cassandra

34 lines 3.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CommonLayout = CommonLayout; 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 = 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 = (0, react_1.useContext)(react_ui_1.ThemeContext); return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${CommonLayout_styles_1.jsStyles.commonLayout(theme)} ${withArrow ? CommonLayout_styles_1.jsStyles.withArrow() : ""}` }, restProps, { children: [topRightTools && (0, jsx_runtime_1.jsx)("div", { className: CommonLayout_styles_1.jsStyles.topRightTools(), children: topRightTools }), children] }))); } CommonLayout.Content = function Content(_a) { var { children } = _a, restProps = tslib_1.__rest(_a, ["children"]); return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: CommonLayout_styles_1.jsStyles.content() }, restProps, { children: children }))); }; CommonLayout.Header = function Header(_a) { var { title, tools, children, borderBottom } = _a, restProps = tslib_1.__rest(_a, ["title", "tools", "children", "borderBottom"]); const theme = (0, react_1.useContext)(react_ui_1.ThemeContext); return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${CommonLayout_styles_1.jsStyles.header()} ${borderBottom ? CommonLayout_styles_1.jsStyles.borderBottom(theme) : ""}` }, restProps, { children: [(0, jsx_runtime_1.jsxs)(react_stack_layout_1.RowStack, { baseline: true, block: true, gap: 2, children: [(0, jsx_runtime_1.jsx)(react_stack_layout_1.Fit, { children: (0, jsx_runtime_1.jsx)("h2", { className: CommonLayout_styles_1.jsStyles.headerTitle(), "data-tid": "Header", children: title }) }), tools && (0, jsx_runtime_1.jsx)(react_stack_layout_1.Fill, { children: tools })] }), children && (0, jsx_runtime_1.jsx)("div", { className: `${CommonLayout_styles_1.jsStyles.content()} ${CommonLayout_styles_1.jsStyles.headerContent()}`, children: children })] }))); }; CommonLayout.GoBack = function CommonLayoutGoBack({ to }) { const theme = (0, react_1.useContext)(react_ui_1.ThemeContext); return ((0, jsx_runtime_1.jsx)(RouterLink_1.RouterLink, { "data-tid": "GoBack", to: to, className: CommonLayout_styles_1.jsStyles.backLink(), children: (0, jsx_runtime_1.jsx)(ArrowALeftIcon24Regular_1.ArrowALeftIcon24Regular, { align: "none", className: CommonLayout_styles_1.jsStyles.backLinkIcon(theme) }) })); }; CommonLayout.ContentLoader = function ContentLoader(props) { const { active, children } = props, restProps = tslib_1.__rest(props, ["active", "children"]); return ((0, jsx_runtime_1.jsx)(react_ui_1.Loader, Object.assign({ className: CommonLayout_styles_1.jsStyles.loader(), active: active, type: "big" }, restProps, { children: children }))); }; //# sourceMappingURL=CommonLayout.js.map