Browse Source

refactor: use Keybind component in titlebar search button

David Hill 1 month ago
parent
commit
b18fb16e9c
1 changed files with 2 additions and 10 deletions
  1. 2 10
      packages/app/src/components/session/session-header.tsx

+ 2 - 10
packages/app/src/components/session/session-header.tsx

@@ -16,6 +16,7 @@ import { Button } from "@opencode-ai/ui/button"
 import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip"
 import { Popover } from "@opencode-ai/ui/popover"
 import { TextField } from "@opencode-ai/ui/text-field"
+import { Keybind } from "@opencode-ai/ui/keybind"
 
 export function SessionHeader() {
   const globalSDK = useGlobalSDK()
@@ -64,16 +65,7 @@ export function SessionHeader() {
                 </span>
               </div>
 
-              <Show when={hotkey()}>
-                {(keybind) => (
-                  <span
-                    class="shrink-0 flex items-center justify-center h-5 px-2 rounded-[2px] bg-surface-base text-12-medium text-text-weak"
-                    style={{ "box-shadow": "var(--shadow-xxs-border)" }}
-                  >
-                    {keybind()}
-                  </span>
-                )}
-              </Show>
+              <Show when={hotkey()}>{(keybind) => <Keybind>{keybind()}</Keybind>}</Show>
             </button>
           </Portal>
         )}