import React from "react" interface StepProps { title: string children: React.ReactNode } const Step: React.FC = ({ title, children }) => (
{/* placeholder — actual badge content injected by Steps wrapper below */}

{title}

{children}
) interface StepsProps { children: React.ReactNode } const Steps: React.FC & { Step: typeof Step } = ({ children }) => { const items = React.Children.toArray(children).filter(React.isValidElement) return (
{items.map((child, index) => { // We expect each child to be a ; inject the Step N badge // before its title. We rebuild the child so the rendering stays self // contained inside Steps — callers don't need to pass the number. const element = child as React.ReactElement return (
Step {index + 1}

{element.props.title}

{element.props.children}
) })}
) } Steps.Step = Step export { Steps }