import { Icon } from '@wordpress/components'; type StepsProps = { active: number; steps: Array< Step >; }; type Step = { title: string; text: string; }; const getStepCn = ( id: number, active: number ) => { const stepClasses = [ 'gs-step' ]; if ( id === active ) { stepClasses.push( 'gs-step--active' ); } if ( id < active ) { stepClasses.push( 'gs-step--completed' ); } return stepClasses.join( ' ' ); }; export default function Steps( props: StepsProps ) { const { active, steps } = props; return (
{ steps.map( ( s, index ) => (
{ s.title } { s.text }
) ) }
); }