@ozen-ui/kit
Version:
React component library
15 lines (14 loc) • 1.02 kB
JavaScript
import { __assign, __rest } from "tslib";
import React from 'react';
import { cn } from '../../../../utils/classname';
import { polymorphicComponentWithRef } from '../../../../utils/polymorphicComponentWithRef';
import { Button } from '../../../ButtonNext';
import { useSectionMessageContext } from '../../SectionMessageContext';
import { SECTION_MESSAGE_BUTTON_DEFAULT_TAG } from './constants';
export var cnSectionMessageButton = cn('SectionMessageButton');
export var SectionMessageButton = polymorphicComponentWithRef(function (_a, ref) {
var children = _a.children, className = _a.className, _b = _a.as, as = _b === void 0 ? SECTION_MESSAGE_BUTTON_DEFAULT_TAG : _b, other = __rest(_a, ["children", "className", "as"]);
var size = useSectionMessageContext().size;
return (React.createElement(Button, __assign({}, other, { as: as, ref: ref, size: size, className: cnSectionMessageButton('', [className]), variant: "function" }), children));
});
SectionMessageButton.displayName = 'SectionMessageButton';