refactor: inline useCommandKey as MOD_KEY constant in two call sites

This commit is contained in:
simosmik
2026-04-30 08:19:35 +00:00
parent 67ffaa7eff
commit 50e02e7c3e
3 changed files with 8 additions and 16 deletions

View File

@@ -3,7 +3,6 @@ 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,
@@ -28,6 +27,9 @@ import {
Card,
} from "../../../../shared/view/ui";
const MOD_KEY =
typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl";
type ProviderSelectionEmptyStateProps = {
selectedSession: ProjectSession | null;
currentSessionId: string | null;
@@ -108,7 +110,6 @@ export default function ProviderSelectionEmptyState({
}: ProviderSelectionEmptyStateProps) {
const { t } = useTranslation("chat");
const { isWindowsServer } = useServerPlatform();
const { modKey } = useCommandKey();
const [dialogOpen, setDialogOpen] = useState(false);
const visibleProviderGroups = useMemo(
@@ -293,7 +294,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]">
{modKey}
{MOD_KEY}
<span>K</span>
</kbd>
<span>to search sessions, files, and commits</span>