|
1 | 1 | import { cn } from "@/lib/utils"; |
2 | 2 | import { Icon } from "@/components/Icon"; |
| 3 | +import React from "react"; |
3 | 4 |
|
4 | 5 | type Modifier = "shift" | "ctrlorcommand" | "alt" | "meta" | "esc"; |
5 | 6 |
|
@@ -46,21 +47,21 @@ function KeyHintKeys({ modifiers, keys }: KeyHintItemProps) { |
46 | 47 | return ( |
47 | 48 | <div className="flex flex-row items-center gap-1"> |
48 | 49 | {modifiers.map((modifier, index) => ( |
49 | | - <> |
| 50 | + <React.Fragment key={modifier}> |
50 | 51 | <Key value={modifierMap[modifier]} /> |
51 | 52 | {index < modifiers.length - 1 && ( |
52 | 53 | <span className="text-sm text-body-muted">+</span> |
53 | 54 | )} |
54 | | - </> |
| 55 | + </React.Fragment> |
55 | 56 | ))} |
56 | 57 | {keys.length > 0 && <span className="text-sm text-body-muted">+</span>} |
57 | 58 | {keys.map((key, index) => ( |
58 | | - <> |
| 59 | + <React.Fragment key={key}> |
59 | 60 | <Key value={key.toUpperCase()} /> |
60 | 61 | {index < keys.length - 1 && ( |
61 | 62 | <span className="text-sm text-body-muted">+</span> |
62 | 63 | )} |
63 | | - </> |
| 64 | + </React.Fragment> |
64 | 65 | ))} |
65 | 66 | </div> |
66 | 67 | ); |
@@ -96,13 +97,14 @@ export function KeyHint({ |
96 | 97 | <div className="flex w-full flex-row items-center self-start border-b px-2.5 py-0.5 text-[10px] font-semibold tracking-wide text-body-muted uppercase select-none dark:text-body-muted/80"> |
97 | 98 | <div>{titleText}</div> |
98 | 99 | {dismissable && ( |
99 | | - <div |
| 100 | + <button |
| 101 | + type="button" |
100 | 102 | className="ml-auto cursor-pointer hover:text-foreground" |
101 | 103 | onClick={onDismiss} |
102 | | - title="Close" |
| 104 | + aria-label="Dismiss" |
103 | 105 | > |
104 | 106 | <Icon name="x" className="h-3.5 w-3.5" /> |
105 | | - </div> |
| 107 | + </button> |
106 | 108 | )} |
107 | 109 | </div> |
108 | 110 | <div className="flex flex-row items-center gap-1 px-4 py-3.5"> |
|
0 commit comments