mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-05-06 05:48:41 +00:00
perf: use biome
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { ReactNode, useCallback, useState } from "react"
|
||||
import { type ReactNode, useCallback, useState } from "react";
|
||||
|
||||
import { CommandContext } from "./command-context"
|
||||
import { CommandContext } from "./command-context";
|
||||
|
||||
export function CommandProvider({ children }: { children: ReactNode }) {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const openCommand = useCallback(() => setIsOpen(true), [])
|
||||
const closeCommand = useCallback(() => setIsOpen(false), [])
|
||||
const toggleCommand = useCallback(() => setIsOpen((prev) => !prev), [])
|
||||
const openCommand = useCallback(() => setIsOpen(true), []);
|
||||
const closeCommand = useCallback(() => setIsOpen(false), []);
|
||||
const toggleCommand = useCallback(() => setIsOpen((prev) => !prev), []);
|
||||
|
||||
return (
|
||||
<CommandContext.Provider
|
||||
value={{
|
||||
isOpen,
|
||||
openCommand,
|
||||
closeCommand,
|
||||
toggleCommand,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</CommandContext.Provider>
|
||||
)
|
||||
return (
|
||||
<CommandContext.Provider
|
||||
value={{
|
||||
isOpen,
|
||||
openCommand,
|
||||
closeCommand,
|
||||
toggleCommand,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</CommandContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user