microsoft/hve-core

Public

mirrored from https://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
feat/1637-l6-agents

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

44lines · 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 resolvedIcon = useBaseUrl(icon ?? '');
25 const iconUrl = icon ? resolvedIcon : undefined;
26 return (
27 <div className={styles.boxCard}>
28 {iconUrl && (
29 <div className={styles.boxCardIcon}>
30 <img src={iconUrl} alt="" aria-hidden="true" width="48" height="48" />
31 </div>
32 )}
33 <h3 className={styles.boxCardTitle}>{title}</h3>
34 {description && <p className={styles.cardDescription}>{description}</p>}
35 <ul className={styles.boxCardLinks}>
36 {links.map((link) => (
37 <li key={link.href}>
38 <Link to={link.href}>{link.label}</Link>
39 </li>
40 ))}
41 </ul>
42 </div>
43 );
44}
45