/* eslint-disable @typescript-eslint/ban-ts-ignore */ import classNames from 'classnames' import PropTypes, { InferProps } from 'prop-types' import React from 'react' import { Text, View } from '@tarojs/components' import { CommonEvent } from '@tarojs/components/types/common' import { AtStepsProps } from '../../../types/steps' import AtIcon from '../icon' export default class AtSteps extends React.Component { public static defaultProps: AtStepsProps public static propTypes: InferProps private handleClick(current: number, event: CommonEvent): void { this.props.onChange(current, event) } public render(): JSX.Element { const { customStyle, className, items, current } = this.props return ( {!!items && items.map((item, i) => { const active = i === current const inactive = i !== current return ( {i !== 0 && } {item.status ? ( // ) : ( {item.icon ? ( ) : ( {i + 1} )} )} {i !== items.length - 1 && ( )} {item.title} {item.desc} ) })} ) } } AtSteps.defaultProps = { customStyle: '', className: '', current: 0, items: [], // eslint-disable-next-line @typescript-eslint/no-empty-function onChange: (): void => {}, } AtSteps.propTypes = { customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]), current: PropTypes.number, items: PropTypes.array, onChange: PropTypes.func, }