| 1 | "use client"; |
| 2 | |
| 3 | import { Card, CardContent |
| 4 | import { cn } |
| 5 | |
| 6 | /** Clickable when it opens something: as a dialog trigger, the dialog passes its click handler in through `props`. */ |
| 7 | export function StartCard({ |
| 8 | icon, |
| 9 | title, |
| 10 | description, |
| 11 | ...props |
| 12 | }: { |
| 13 | icon: React |
| 14 | title: string |
| 15 | description: string |
| 16 | } & React |
| 17 | const interactive = |
| 18 | return ( |
| 19 | <Card |
| 20 | {...props} |
| 21 | role={interactive ? |
| 22 | tabIndex={interactive ? |
| 23 | onKeyDown={(event) |
| 24 | if (interactive && (event |
| 25 | event.preventDefault(); |
| 26 | event.currentTarget.click |
| 27 | } |
| 28 | }} |
| 29 | className={cn( |
| 30 | "gap-3", |
| 31 | interactive && "cursor-pointer transition-colors hover:bg-muted/50" |
| 32 | )} |
| 33 | > |
| 34 | <CardHeader> |
| 35 | <span className="text-muted-foreground |
| 36 | <CardTitle className=" |
| 37 | </CardHeader> |
| 38 | <CardContent> |
| 39 | <p className="text-sm text-muted-foreground |
| 40 | </CardContent> |
| 41 | </Card> |
| 42 | ); |
| 43 | } |