UNPKG

@ozen-ui/kit

Version:

React component library

15 lines (14 loc) 962 B
import { __assign, __rest } from "tslib"; import React from 'react'; import { cn } from '../../../../utils/classname'; import { polymorphicComponentWithRef } from '../../../../utils/polymorphicComponentWithRef'; import { Button } from '../../../ButtonNext'; import { useDialogContext } from '../../DialogContext'; import { DIALOG_FOOTER_BUTTON_DEFAULT_TAG } from './constants'; export var cnDialogFooterButton = cn('DialogNextFooterButton'); export var DialogFooterButton = polymorphicComponentWithRef(function (_a, ref) { var children = _a.children, className = _a.className, _b = _a.as, as = _b === void 0 ? DIALOG_FOOTER_BUTTON_DEFAULT_TAG : _b, other = __rest(_a, ["children", "className", "as"]); var size = useDialogContext().size; return (React.createElement(Button, __assign({}, other, { as: as, ref: ref, className: cnDialogFooterButton('', [className]), size: size }), children)); }); DialogFooterButton.displayName = 'DialogFooterButton';