mirror of
https://github.com/github/awesome-copilot.git
synced 2026-10-15 00:01:58 +00:00
31 lines
785 B
TypeScript
31 lines
785 B
TypeScript
import { HeartFillIcon } from "@primer/octicons-react";
|
|
|
|
import styles from "./styles/ContributorsNavButton.module.css";
|
|
|
|
type ContributorsNavButtonProps = {
|
|
href: string;
|
|
current?: boolean;
|
|
/** Live contributor count, injected from build-time data. */
|
|
total?: number;
|
|
};
|
|
|
|
export function ContributorsNavButton({
|
|
href,
|
|
current = false,
|
|
total = 0,
|
|
}: ContributorsNavButtonProps) {
|
|
return (
|
|
<a
|
|
className={styles.trigger}
|
|
href={href}
|
|
aria-current={current ? "page" : undefined}
|
|
aria-label={`Meet all ${total.toLocaleString()} contributors`}
|
|
>
|
|
<span className={styles.heart} aria-hidden="true">
|
|
<HeartFillIcon size={14} />
|
|
</span>
|
|
<span className={styles.countLabel}>{total.toLocaleString()}</span>
|
|
</a>
|
|
);
|
|
}
|