@bos-alpha/data
Version:
数据管理
27 lines (26 loc) • 1.56 kB
JavaScript
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from 'react';
import { Icon } from '@bos-alpha/common';
import styled from '@emotion/styled';
export var ShowMore = function (_a) {
var children = _a.children;
var _b = useState(false), visible = _b[0], setVisible = _b[1];
return (_jsxs("div", { children: [visible ? _jsx("div", { children: children }, void 0) : null, _jsxs(SwitchBtn, __assign({ onClick: function () { return setVisible(!visible); } }, { children: [visible ? '收起' : '展开', "\u8BE6\u7EC6\u4FE1\u606F", _jsx(Icon, { type: visible ? 'iconicon_arrowup' : 'iconicon_arrowdown' }, void 0)] }), void 0)] }, void 0));
};
var SwitchBtn = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-top: 20px;\n color: #2878ff;\n cursor: pointer;\n"], ["\n padding-top: 20px;\n color: #2878ff;\n cursor: pointer;\n"])));
var templateObject_1;