UNPKG

@ozen-ui/kit

Version:

React component library

26 lines (25 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DialogTitle = exports.cnDialogTitle = void 0; var tslib_1 = require("tslib"); var react_1 = tslib_1.__importStar(require("react")); var classname_1 = require("../../../../utils/classname"); var renderContent_1 = require("../../../../utils/renderContent"); var DialogContext_1 = require("../../DialogContext"); exports.cnDialogTitle = (0, classname_1.cn)('DialogNextTitle'); exports.DialogTitle = (0, react_1.forwardRef)(function (_a, ref) { var children = _a.children, className = _a.className, iconLeft = _a.iconLeft, other = tslib_1.__rest(_a, ["children", "className", "iconLeft"]); var _b = (0, DialogContext_1.useDialogContext)(), deviceType = _b.deviceType, size = _b.size; var renderIcon = function (content) { return (0, renderContent_1.renderContent)({ content: content, props: { size: 'm', }, }); }; return (react_1.default.createElement("div", tslib_1.__assign({}, other, { ref: ref, className: (0, exports.cnDialogTitle)({ size: size, deviceType: deviceType }, [className]) }), renderIcon(iconLeft), children)); }); exports.DialogTitle.displayName = 'DialogTitle';