@brightlayer-ui/react-auth-workflow
Version:
Re-usable workflow components for Authentication and Registration within Eaton applications.
38 lines (37 loc) • 2 kB
JavaScript
import React from 'react';
import { WorkflowCard, WorkflowCardActions, WorkflowCardBody, WorkflowCardHeader, WorkflowCardInstructions, } from '../../components/WorkflowCard/index.js';
import { EmptyState } from '@brightlayer-ui/react-components';
import Box from '@mui/material/Box';
/**
* Component that renders a success screen
*
* @param {SuccessScreenProps} props - props of SuccessScreen base component
*
* @category Component
*/
export const SuccessScreenBase = (props) => {
const { EmptyStateProps, dismissButtonLabel = '', canDismiss, onDismiss, WorkflowCardBaseProps: cardBaseProps = {}, WorkflowCardInstructionProps: instructionsProps = {}, WorkflowCardActionsProps: actionsProps = {}, WorkflowCardHeaderProps: headerProps = {}, ...otherProps } = props;
return (React.createElement(WorkflowCard, { ...cardBaseProps, ...otherProps },
React.createElement(WorkflowCardHeader, { ...headerProps }),
Object.keys(instructionsProps).length !== 0 && React.createElement(WorkflowCardInstructions, { ...instructionsProps }),
React.createElement(WorkflowCardBody, null,
React.createElement(Box, { sx: [
{
display: 'flex',
flex: '1 1 0%',
justifyContent: 'center',
alignItems: 'center',
height: '100%',
minHeight: { md: 500, sm: 'auto' },
},
] }, EmptyStateProps && (React.createElement(EmptyState, { sx: {
color: 'inherit',
p: 0,
}, ...EmptyStateProps })))),
React.createElement(WorkflowCardActions, { ...actionsProps, nextLabel: dismissButtonLabel || actionsProps.nextLabel, canGoNext: canDismiss, onNext: () => {
if (onDismiss)
onDismiss();
if (actionsProps.onNext)
actionsProps.onNext();
} })));
};