-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed807c2
commit 2e23a17
Showing
14 changed files
with
903 additions
and
742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { Step } from '@/components/progress-steps/Step'; | ||
import { useStep } from '@/components/progress-steps/useStep'; | ||
import { ReactElement, useEffect } from 'react'; | ||
|
||
interface OnboardStep { | ||
name: string; | ||
} | ||
|
||
interface Props { | ||
stepName: string; | ||
} | ||
|
||
export default function JobsProgressSteps(props: Props): ReactElement { | ||
const { stepName } = props; | ||
|
||
//maxStep must match the steps.length below | ||
const [currentStep, { setStep }] = useStep({ | ||
maxStep: 4, | ||
initialStep: 0, | ||
}); | ||
|
||
const steps: OnboardStep[] = [ | ||
{ | ||
name: 'define', | ||
}, | ||
{ | ||
name: 'connect', | ||
}, | ||
{ | ||
name: 'schema', | ||
}, | ||
{ | ||
name: 'subset', | ||
}, | ||
]; | ||
|
||
useEffect(() => { | ||
const ind = steps?.findIndex((item) => item.name == stepName); | ||
setStep(ind); | ||
}, [stepName]); | ||
|
||
return ( | ||
<div> | ||
<div className="flex flex-row items-center justify-center mt-5"> | ||
{steps.map((step, idx) => { | ||
return ( | ||
<Step | ||
isCompleted={currentStep > idx} | ||
key={step.name} | ||
isActive={currentStep === idx} | ||
isLastStep={steps.length === idx + 1} | ||
name={step.name} | ||
/> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.