Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@sushiswap/ui / stepper / vertical / Step.tsx
Size: Mime:
import React, { Children, cloneElement, FC, isValidElement } from 'react'

import { StepContentInterface } from './StepContent'
import { StepLabelInterface } from './StepLabel'
import { StepDetails } from './Stepper'

export interface StepInterface extends StepDetails {
  children: Array<React.ReactElement<StepLabelInterface | StepContentInterface>>
}

export const Step: FC<StepInterface> = ({ _index, _active, _last, children }) => {
  return (
    <div className="flex flex-col gap-2">
      <div className="flex flex-col">
        {Children.map(children, (child) => {
          if (isValidElement(child)) {
            return cloneElement(child, {
              _index,
              _active,
              _last,
            })
          }
        })}
      </div>
    </div>
  )
}