microsoft/hve-core
Publicmirrored fromhttps://github.com/microsoft/hve-coreAvailable
docs/docusaurus/src/components/Cards/IconCard.tsx
32lines · modecode
| 1 | import React from 'react'; |
| 2 | import Link from '@docusaurus/Link'; |
| 3 | import styles from './styles.module.css'; |
| 4 | |
| 5 | interface IconCardProps { |
| 6 | icon: React.ReactNode; |
| 7 | supertitle: string; |
| 8 | title: string; |
| 9 | href: string; |
| 10 | description?: string; |
| 11 | } |
| 12 | |
| 13 | export default function IconCard({ |
| 14 | icon, |
| 15 | supertitle, |
| 16 | title, |
| 17 | href, |
| 18 | description, |
| 19 | }: IconCardProps): React.ReactElement { |
| 20 | return ( |
| 21 | <article className={styles.card}> |
| 22 | <div className={styles.iconCardLayout}> |
| 23 | <div className={styles.iconContainer}>{icon}</div> |
| 24 | <div className={styles.iconCardContent}> |
| 25 | <span className={styles.supertitle}>{supertitle}</span> |
| 26 | <Link to={href} className={styles.cardTitle}>{title}</Link> |
| 27 | {description && <p className={styles.cardDescription}>{description}</p>} |
| 28 | </div> |
| 29 | </div> |
| 30 | </article> |
| 31 | ); |
| 32 | } |
| 33 | |