2023-04-23 22:24:53 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2023-12-02 19:21:43 +01:00
|
|
|
|
2023-05-09 03:11:56 +02:00
|
|
|
import { Check } from 'flavours/glitch/components/check';
|
2023-12-02 19:21:43 +01:00
|
|
|
import { Icon } from 'flavours/glitch/components/icon';
|
2023-04-23 22:24:53 +02:00
|
|
|
|
2023-06-23 16:34:27 +02:00
|
|
|
import ArrowSmallRight from './arrow_small_right';
|
|
|
|
|
2023-04-23 22:24:53 +02:00
|
|
|
const Step = ({ label, description, icon, completed, onClick, href }) => {
|
|
|
|
const content = (
|
|
|
|
<>
|
|
|
|
<div className='onboarding__steps__item__icon'>
|
|
|
|
<Icon id={icon} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className='onboarding__steps__item__description'>
|
|
|
|
<h6>{label}</h6>
|
|
|
|
<p>{description}</p>
|
|
|
|
</div>
|
|
|
|
|
2023-06-23 16:34:27 +02:00
|
|
|
<div className={completed ? 'onboarding__steps__item__progress' : 'onboarding__steps__item__go'}>
|
|
|
|
{completed ? <Check /> : <ArrowSmallRight />}
|
|
|
|
</div>
|
2023-04-23 22:24:53 +02:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
|
|
|
if (href) {
|
|
|
|
return (
|
|
|
|
<a href={href} onClick={onClick} target='_blank' rel='noopener' className='onboarding__steps__item'>
|
|
|
|
{content}
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button onClick={onClick} className='onboarding__steps__item'>
|
|
|
|
{content}
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
Step.propTypes = {
|
|
|
|
label: PropTypes.node,
|
|
|
|
description: PropTypes.node,
|
|
|
|
icon: PropTypes.string,
|
|
|
|
completed: PropTypes.bool,
|
|
|
|
href: PropTypes.string,
|
|
|
|
onClick: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
2023-05-09 03:11:56 +02:00
|
|
|
export default Step;
|