UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

50 lines (49 loc) 2.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "TableLayoutControl", { enumerable: true, get: function() { return TableLayoutControl; } }); var _jsxruntime = require("react/jsx-runtime"); var _core = require("@mantine/core"); var _Table = require("../Table"); var _TableContext = require("../TableContext"); var TableLayoutControl = function() { var _useTableContext = (0, _TableContext.useTableContext)(), layouts = _useTableContext.layouts, store = _useTableContext.store; return layouts.length > 1 ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Grid.Col, { order: _Table.TableComponentsOrder.LayoutControl, span: "content", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.SegmentedControl, { data: layouts.map(function(param) { var displayName = param.displayName, Icon = param.Icon; return { value: displayName, label: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_core.Center, { children: [ Icon ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ /*#__PURE__*/ (0, _jsxruntime.jsx)(Icon, { height: 16 }), /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Space, { w: "xs" }) ] }) : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Box, { children: displayName }) ] }) }; }), value: store.state.layout === null ? layouts[0].displayName : store.state.layout, onChange: store.setLayout }) }) : null; }; //# sourceMappingURL=TableLayoutControl.js.map