refactor(command-palette): extract useCommandKey and SETTINGS_MAIN_TABS metadata

This commit is contained in:
simosmik
2026-04-30 07:51:28 +00:00
parent f1d7df2b1e
commit 384cee2995
5 changed files with 47 additions and 30 deletions

View File

@@ -3,6 +3,7 @@ import { Check, ChevronDown } from "lucide-react";
import { useTranslation } from "react-i18next";
import { useServerPlatform } from "../../../../hooks/useServerPlatform";
import { useCommandKey } from "../../../../hooks/useCommandKey";
import SessionProviderLogo from "../../../llm-logo-provider/SessionProviderLogo";
import {
CLAUDE_MODELS,
@@ -107,6 +108,7 @@ export default function ProviderSelectionEmptyState({
}: ProviderSelectionEmptyStateProps) {
const { t } = useTranslation("chat");
const { isWindowsServer } = useServerPlatform();
const { modKey } = useCommandKey();
const [dialogOpen, setDialogOpen] = useState(false);
const visibleProviderGroups = useMemo(
@@ -291,7 +293,7 @@ export default function ProviderSelectionEmptyState({
<p className="mt-3 flex items-center justify-center gap-1.5 text-center text-xs text-muted-foreground/60">
<span>Press</span>
<kbd className="inline-flex items-center gap-0.5 rounded border border-border/60 bg-muted/40 px-1.5 py-0.5 font-mono text-[10px]">
{typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl"}
{modKey}
<span>K</span>
</kbd>
<span>to search sessions, files, and commits</span>