import React from 'react' ; import { MemoryRouter } from 'react-router-dom' ; import Welcome from './Welcome' ; import { NewCredentials , Props } from './NewCredentials' ; import { mockedProps } from './fixtures/fixtures' ; export default { title : 'Teleport/Welcome' } ; export const GetStarted = ( ) => < MockedWelcome url = "/web/invite/1234" / > ; export const Continue = ( ) => ( < MockedWelcome url = "/web/invite/1234/continue" Form = { Otp } / > ) ; export const GetStartedReset = ( ) => < MockedWelcome url = "/web/reset/1234" / > ; export const ContinueReset = ( ) => ( < MockedWelcome url = "/web/reset/1234/continue" Form = { Otp } / > ) ; export const AuthMfaOn = ( ) => ( < MockedWelcome url = "/web/invite/1234/continue" Form = { MfaOn } / > ) ; export const AuthMfaOnWithU2f = ( ) => ( < MockedWelcome url = "/web/invite/1234/continue" Form = { MfaOnWithU2f } / > ) ; export const AuthMfaOptional = ( ) => ( < MockedWelcome url = "/web/invite/1234/continue" Form = { MfaOptional } / > ) ; export const AuthMfaOnOtp = ( ) => ( < MockedWelcome url = "/web/invite/1234/continue" Form = { Otp } / > ) ; const MfaOn = ( props ) => ( < NewCredentials { ... props } { ... mockedProps } auth2faType = "on" / > ) ; const Otp = ( props ) => ( < NewCredentials { ... props } { ... mockedProps } auth2faType = "otp" / > ) ; const MfaOnWithU2f = ( props ) => ( < NewCredentials { ... props } { ... mockedProps } auth2faType = "on" preferredMfaType = "u2f" / > ) ; const MfaOptional = ( props ) => ( < NewCredentials { ... props } { ... mockedProps } auth2faType = "optional" / > ) ; type MockedWelcomeProps = { url : string ; Form ? : React . FC < Props > ; } ; function MockedWelcome ( { url , Form } ) { return ( < MemoryRouter initialEntries = { [ url ] } > < Welcome CustomForm = { Form } /> < /MemoryRouter>); } GetStarted . storyName = 'GetStarted' ; GetStartedReset . storyName = 'GetStartedReset' ; ContinueReset . storyName = 'ContinueReset' ; Continue . storyName = 'Continue' ; AuthMfaOnOtp . storyName = 'MfaOnOtp' ; AuthMfaOn . storyName = 'MfaOn' ; AuthMfaOptional . storyName = 'MfaOptional' ; AuthMfaOnWithU2f . storyName = 'MfaOnWithU2f' ;