Skip to content

Instantly share code, notes, and snippets.

@nicolasleal570
Created September 10, 2020 19:46
Show Gist options
  • Save nicolasleal570/d2a47d382e0b66c295ef86e5ac3cdc14 to your computer and use it in GitHub Desktop.
Save nicolasleal570/d2a47d382e0b66c295ef86e5ac3cdc14 to your computer and use it in GitHub Desktop.
import React from "react";
interface Props {
index: number;
steps: Array<{ id: number; title: string }>;
}
export default function ({ index, steps = [] }: Props) {
return (
<ul className="progressBar">
{steps.map(({ id, title }) => (
<li className={`${index === id || index > id ? "active" : ""}`}>
{title}
</li>
))}
</ul>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment