mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 17:58:43 -05:00
* chore(deps): update dependency react-router-dom to v7 * chore: additions --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: caele <tsm@qlik.com>
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import Step from '@mui/material/Step';
|
|
import { useNavigate } from 'react-router';
|
|
import { ThemeWrapper } from '../ThemeWrapper';
|
|
import { StepperWrapper, CustomStepLabel } from './styles';
|
|
import { steps } from '../../constants/connectionSteps';
|
|
|
|
import { useRootContext } from '../../contexts/RootContext';
|
|
|
|
const ConnectionSteps = () => {
|
|
const navigate = useNavigate();
|
|
const { activeStep, glob, error, setError } = useRootContext();
|
|
|
|
const handleStepperClick = () => {
|
|
if (!(glob || error)) return;
|
|
setError();
|
|
navigate('/');
|
|
};
|
|
|
|
return (
|
|
<ThemeWrapper themeName="dark">
|
|
<StepperWrapper alternativeLabel activeStep={activeStep}>
|
|
{steps.map((label, i) => (
|
|
<Step key={label}>
|
|
<CustomStepLabel onClick={handleStepperClick} shouldBePointer={glob || error} error={!!error && !i}>
|
|
{label}
|
|
</CustomStepLabel>
|
|
</Step>
|
|
))}
|
|
</StepperWrapper>
|
|
</ThemeWrapper>
|
|
);
|
|
};
|
|
|
|
export default ConnectionSteps;
|