microsoft/hve-core

Public

mirrored fromhttps://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
feat/docs-new-user

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/docusaurus/src/components/Cards/BoxCard.tsx

43lines · modecode

1import React from 'react';
2import Link from '@docusaurus/Link';
3import useBaseUrl from '@docusaurus/useBaseUrl';
4import styles from './styles.module.css';
5
6interface BoxCardLink {
7 label: string;
8 href: string;
9}
10
11interface BoxCardProps {
12 title: string;
13 description?: string;
14 links: BoxCardLink[];
15 icon?: string;
16}
17
18export default function BoxCard({
19 title,
20 description,
21 links,
22 icon,
23}: BoxCardProps): React.ReactElement {
24 const iconUrl = icon ? useBaseUrl(icon) : undefined;
25 return (
26 <div className={styles.boxCard}>
27 {iconUrl && (
28 <div className={styles.boxCardIcon}>
29 <img src={iconUrl} alt="" width="48" height="48" />
30 </div>
31 )}
32 <h3 className={styles.boxCardTitle}>{title}</h3>
33 {description && <p className={styles.cardDescription}>{description}</p>}
34 <ul className={styles.boxCardLinks}>
35 {links.map((link) => (
36 <li key={link.href}>
37 <Link to={link.href}>{link.label}</Link>
38 </li>
39 ))}
40 </ul>
41 </div>
42 );
43}
44