({ example }: Props)
| 7 | example: CodeExample |
| 8 | } |
| 9 | export const CodeExampleCard = ({ example }: Props) => { |
| 10 | return ( |
| 11 | <a |
| 12 | className="Box d-flex flex-column flex-justify-between height-full color-shadow-medium hover-shadow-large no-underline color-fg-default" |
| 13 | data-testid="code-example-card" |
| 14 | href={`https://github.com/${example.href}`} |
| 15 | > |
| 16 | <div className="p-4"> |
| 17 | <h3 className="f4">{example.title}</h3> |
| 18 | <p className="mt-2 mb-4 color-fg-muted">{example.description}</p> |
| 19 | <div className="d-flex flex-wrap"> |
| 20 | {example.tags.map((tag) => { |
| 21 | return ( |
| 22 | <Label key={tag} variant="accent" sx={{ mb: 1, mr: 2 }}> |
| 23 | {tag} |
| 24 | </Label> |
| 25 | ) |
| 26 | })} |
| 27 | </div> |
| 28 | </div> |
| 29 | <footer className="border-top p-4 color-fg-muted d-flex flex-items-center"> |
| 30 | <RepoIcon aria-label="repository URL" className="flex-shrink-0" /> |
| 31 | <TruncateLines |
| 32 | as="span" |
| 33 | maxLines={1} |
| 34 | className="ml-2 text-mono text-small color-fg-accent line-break-anywhere" |
| 35 | > |
| 36 | {example.href} |
| 37 | </TruncateLines> |
| 38 | </footer> |
| 39 | </a> |
| 40 | ) |
| 41 | } |
nothing calls this directly
no outgoing calls
no test coverage detected