microsoft/hve-core
Publicmirrored fromhttps://github.com/microsoft/hve-coreAvailable
docs/docusaurus/src/components/CollectionCards/index.tsx
33lines · modecode
| 1 | import React from 'react'; |
| 2 | import Link from '@docusaurus/Link'; |
| 3 | import type { CollectionCardData } from '../../data/collectionCards'; |
| 4 | import styles from './styles.module.css'; |
| 5 | |
| 6 | const maturityClass: Record<CollectionCardData['maturity'], string> = { |
| 7 | Stable: styles.maturityStable, |
| 8 | Preview: styles.maturityPreview, |
| 9 | Experimental: styles.maturityExperimental, |
| 10 | }; |
| 11 | |
| 12 | export default function CollectionCard({ |
| 13 | name, |
| 14 | description, |
| 15 | artifacts, |
| 16 | maturity, |
| 17 | href, |
| 18 | }: CollectionCardData): React.ReactElement { |
| 19 | return ( |
| 20 | <article className={styles.collectionCard}> |
| 21 | <div className={styles.collectionHeader}> |
| 22 | <Link to={href} className={styles.collectionName}>{name}</Link> |
| 23 | <span className={`${styles.maturityBadge} ${maturityClass[maturity]}`}> |
| 24 | {maturity} |
| 25 | </span> |
| 26 | </div> |
| 27 | <p className={styles.collectionDescription}>{description}</p> |
| 28 | <p className={styles.artifactCount}> |
| 29 | <strong>{artifacts}</strong> artifacts |
| 30 | </p> |
| 31 | </article> |
| 32 | ); |
| 33 | } |
| 34 | |