@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
19 lines • 1.28 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { STYLES_NAME } from '../../constants/stylesName/stylesName';
import { useStyles } from '../../hooks/useStyles/useStyles';
import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary';
import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent';
import { useGenericComponents } from '../../provider/genericComponents/genericComponentsProvider';
// styles
import { MessageStandAlone } from './messageStandAlone';
const MessageControlledComponent = React.forwardRef(({ ctv, ...props }, ref) => {
const styles = useStyles(STYLES_NAME.MESSAGE, props.variant, ctv);
const { LINK } = useGenericComponents();
return _jsx(MessageStandAlone, { ref: ref, linkComponent: LINK, styles: styles, ...props });
});
MessageControlledComponent.displayName = 'MessageControlledComponent';
const MessageBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(MessageStandAlone, { ...props, ref: ref }) }), children: _jsx(MessageControlledComponent, { ...props, ref: ref }) }));
const MessageControlled = React.forwardRef(MessageBoundary);
export { MessageControlled };
//# sourceMappingURL=messageControlled.js.map