UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

16 lines (15 loc) 1.49 kB
import React from 'react'; import clsx from 'clsx'; import Form from '../form'; import Header from '../header'; import WizardActions from './wizard-actions'; import styles from './styles.css.js'; var WizardForm = function (_a) { var steps = _a.steps, activeStepIndex = _a.activeStepIndex, i18nStrings = _a.i18nStrings, isPrimaryLoading = _a.isPrimaryLoading, onCancelClick = _a.onCancelClick, onPreviousClick = _a.onPreviousClick, onPrimaryClick = _a.onPrimaryClick; var _b = steps[activeStepIndex] || {}, title = _b.title, info = _b.info, description = _b.description, content = _b.content, errorText = _b.errorText, isOptional = _b.isOptional; var isLastStep = activeStepIndex >= steps.length - 1; return (React.createElement(Form, { className: clsx(styles['form-component']), header: React.createElement(Header, { className: clsx(styles['form-header']), variant: "h1", description: description, info: info }, title, isOptional && React.createElement("i", null, " - " + i18nStrings.optional)), actions: React.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? i18nStrings.submitButton : i18nStrings.nextButton, previousButtonText: i18nStrings.previousButton, onCancelClick: onCancelClick, onPreviousClick: onPreviousClick, onPrimaryClick: onPrimaryClick, showPrevious: activeStepIndex !== 0, isPrimaryLoading: isPrimaryLoading }), errorText: errorText }, content)); }; export default WizardForm;