[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-08-11 18:28:50 +00:00
committed by GitHub
parent 957d1b5966
commit ed53bdd0fa
6 changed files with 84 additions and 86 deletions
+10 -12
View File
@@ -4,7 +4,7 @@ import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
const PAGES = ["compose", "application", "postgres", "redis", "mysql"] as const; const PAGES = ["compose", "application", "postgres", "redis", "mysql"] as const;
type Page = typeof PAGES[number]; type Page = (typeof PAGES)[number];
type Shortcuts = Record<string, string>; type Shortcuts = Record<string, string>;
type ShortcutsDictionary = Record<Page, Shortcuts>; type ShortcutsDictionary = Record<Page, Shortcuts>;
@@ -61,14 +61,14 @@ const SHORTCUTS: ShortcutsDictionary = {
}; };
/** /**
* Use this to register keyboard shortcuts for different pages. Each shortcut * Use this to register keyboard shortcuts for different pages. Each shortcut
* must be prefixed with `g` (like GitHub). * must be prefixed with `g` (like GitHub).
* *
* @example * @example
* - `g g` "General", * - `g g` "General",
* - `g e` "Environment", * - `g e` "Environment",
* - `g u` "Domains", * - `g u` "Domains",
*/ */
export function UseKeyboardNav({ forPage }: { forPage: Page }) { export function UseKeyboardNav({ forPage }: { forPage: Page }) {
const [isModPressed, setModPressed] = useState(false); const [isModPressed, setModPressed] = useState(false);
const [timer, setTimer] = useState<NodeJS.Timeout | null>(null); const [timer, setTimer] = useState<NodeJS.Timeout | null>(null);
@@ -97,9 +97,7 @@ export function UseKeyboardNav({ forPage }: { forPage: Page }) {
if (key in shortcuts) { if (key in shortcuts) {
const tab = shortcuts[key]!; const tab = shortcuts[key]!;
router.push( router.push(`${pathname}?${updateSearchParam("tab", tab)}`);
`${pathname}?${updateSearchParam("tab", tab)}`,
);
} }
} else { } else {
if (key === "g") { if (key === "g") {