2023-04-24 06:24:53 +10:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-24 01:15:17 +10:00
|
|
|
|
2023-05-09 11:11:56 +10:00
|
|
|
import { Check } from 'mastodon/components/check';
|
2023-05-24 01:15:17 +10:00
|
|
|
import { Icon } from 'mastodon/components/icon';
|
2023-04-24 06:24:53 +10: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>
|
|
|
|
|
|
|
|
{completed && (
|
|
|
|
<div className='onboarding__steps__item__progress'>
|
|
|
|
<Check />
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
|
|
|
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 11:11:56 +10:00
|
|
|
export default Step;
|