D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
correlations
/
components
/
Wizard
/
Filename :
Wizard.tsx
back
Copy
import React from 'react'; import { useForm, FormProvider, FieldValues } from 'react-hook-form'; import { WizardContent } from './WizardContent'; import { WizardProps } from './types'; import { WizardContextProvider } from './wizardContext'; export function Wizard<T extends FieldValues>(props: WizardProps<T>) { const { defaultValues, pages, onSubmit, navigation } = props; const formMethods = useForm<T>({ defaultValues }); return ( <FormProvider {...formMethods}> <WizardContextProvider pages={pages} onSubmit={onSubmit}> <WizardContent navigation={navigation} /> </WizardContextProvider> </FormProvider> ); }