/* eslint-disable max-len */ /* eslint-disable react/no-array-index-key */ import React, { FC } from 'react'; const getStepItemClass = (current: boolean, final: boolean, finalIcon: string): string => { let className = 'stepper__item'; if (current) { className = `${className} stepper__item--active`; } if (final) { className = `${className} stepper__item--final`; if (finalIcon) { className = `${className} icon-${finalIcon}`; } } return className; }; type Props = { step: number; children: React.JSX.Element[]; stepHeadlines: string[]; introElement?: React.JSX.Element; outroElement?: React.JSX.Element; showFinal?: boolean; finalIcon?: string; title: string; showSteps?: boolean; }; const AUStepComponent: FC = ({ title, step, children, stepHeadlines, introElement = undefined, outroElement = undefined, showFinal = false, finalIcon = '', showSteps = true, }) => (

{title}

{ (showSteps && step > -1 && step < children.length) && (
    { stepHeadlines.map((headline, index) => (
  1. {headline}
  2. )) }
) } { step < 0 && introElement } { children.map((child, index) => (
{child}
)) } { (step > children.length - 1) && outroElement }
); AUStepComponent.displayName = 'AUStepComponent'; export default AUStepComponent;