mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-24 20:58:46 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -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") {
|
||||||
|
|||||||
Reference in New Issue
Block a user