UNPKG

@ozen-ui/kit

Version:

React component library

23 lines (22 loc) 1.01 kB
import { __assign, __rest } from "tslib"; import React, { forwardRef } from 'react'; import { cn } from '../../../../utils/classname'; import { renderContent } from '../../../../utils/renderContent'; import { useDialogContext } from '../../DialogContext'; export var cnDialogTitle = cn('DialogNextTitle'); export var DialogTitle = forwardRef(function (_a, ref) { var children = _a.children, className = _a.className, iconLeft = _a.iconLeft, other = __rest(_a, ["children", "className", "iconLeft"]); var _b = useDialogContext(), deviceType = _b.deviceType, size = _b.size; var renderIcon = function (content) { return renderContent({ content: content, props: { size: 'm', }, }); }; return (React.createElement("div", __assign({}, other, { ref: ref, className: cnDialogTitle({ size: size, deviceType: deviceType }, [className]) }), renderIcon(iconLeft), children)); }); DialogTitle.displayName = 'DialogTitle';