index.tsx 809 B

123456789101112131415161718192021222324
  1. import React from 'react';
  2. import { Wizard } from './Wizard';
  3. import { Step1 } from './StepOneForm';
  4. import { Step2 } from './StepTwoForm';
  5. import { Step3 } from './StepThreeForm';
  6. import { Step4 } from './StepFourForm';
  7. /* eslint-disable react/jsx-key */
  8. export const SyncWizard: React.FunctionComponent<{
  9. onFinish: (data: any) => void;
  10. }> = ({ onFinish }) => {
  11. return (
  12. <Wizard onFinish={onFinish}>
  13. {register => {
  14. return [
  15. <Step1.Form {...register({ key: Step1.KEY, title: Step1.TITLE })} />,
  16. <Step2.Form {...register({ key: Step2.KEY, title: Step2.TITLE })} />,
  17. <Step3.Form {...register({ key: Step3.KEY, title: Step3.TITLE })} />,
  18. <Step4.Form {...register({ key: Step4.KEY, title: Step4.TITLE })} />
  19. ];
  20. }}
  21. </Wizard>
  22. );
  23. };