UNPKG

react-antd-admin-panel

Version:

Easy prototyping admin panel using React and Antd

18 lines 1.12 kB
import React, { useState } from "react"; import { Alert as AlertAnt, Typography } from "antd"; const Inner = (args) => { var _a, _b; return (React.createElement("div", null, args._description && React.createElement(Typography.Text, { style: { fontWeight: 300, fontSize: 12 } }, args._description), args._title && React.createElement(Typography.Title, { level: 4, style: { fontWeight: 400, marginTop: 0, marginBottom: 0 } }, args._title), args._text && React.createElement(Typography.Text, { style: { fontSize: 14 } }, args._text), (_b = (_a = args._render) === null || _a === void 0 ? void 0 : _a.call(args)) !== null && _b !== void 0 ? _b : null)); }; const Alert = (props) => { var _a; let model = props.model; let value = model._fields[0]; const [state, setState] = useState(value); return (React.createElement(AlertAnt, { message: Inner(state), type: (_a = state._type) !== null && _a !== void 0 ? _a : 'info', closable: model._clearable, afterClose: () => model._onChange(false) })); }; export default Alert; //# sourceMappingURL=Alert.js.map