mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-04 12:40:10 +00:00
fix: prettier config
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { useContext } from "react";
|
||||
import { FilterContext, FilterContextType } from "@/context/filter-context";
|
||||
import { FilterContext, FilterContextType } from "@/context/filter-context"
|
||||
import { useContext } from "react"
|
||||
|
||||
const useFilter = (): FilterContextType => {
|
||||
const context = useContext(FilterContext);
|
||||
const context = useContext(FilterContext)
|
||||
if (context === undefined) {
|
||||
throw new Error("useFilter must be used within a FilterProvider");
|
||||
throw new Error("useFilter must be used within a FilterProvider")
|
||||
}
|
||||
return context;
|
||||
};
|
||||
return context
|
||||
}
|
||||
|
||||
export default useFilter;
|
||||
export default useFilter
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { useContext } from "react";
|
||||
import { StatusContext } from "../context/status-context";
|
||||
import { useContext } from "react"
|
||||
|
||||
import { StatusContext } from "../context/status-context"
|
||||
|
||||
export function useStatus() {
|
||||
const context = useContext(StatusContext);
|
||||
const context = useContext(StatusContext)
|
||||
if (context === undefined) {
|
||||
throw new Error("useStatus must be used within a StatusProvider");
|
||||
throw new Error("useStatus must be used within a StatusProvider")
|
||||
}
|
||||
return context;
|
||||
return context
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { useContext } from "react";
|
||||
import { ThemeProviderContext } from "../components/ThemeProvider";
|
||||
import { useContext } from "react"
|
||||
|
||||
import { ThemeProviderContext } from "../components/ThemeProvider"
|
||||
|
||||
export const useTheme = () => {
|
||||
const context = useContext(ThemeProviderContext);
|
||||
const context = useContext(ThemeProviderContext)
|
||||
|
||||
if (context === undefined) {
|
||||
throw new Error("useTheme must be used within a ThemeProvider");
|
||||
throw new Error("useTheme must be used within a ThemeProvider")
|
||||
}
|
||||
|
||||
return context;
|
||||
};
|
||||
return context
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useContext } from "react";
|
||||
import { TooltipContext } from "@/context/tooltip-context";
|
||||
import { TooltipContext } from "@/context/tooltip-context"
|
||||
import { useContext } from "react"
|
||||
|
||||
export const useTooltip = () => {
|
||||
const context = useContext(TooltipContext);
|
||||
const context = useContext(TooltipContext)
|
||||
if (context === undefined) {
|
||||
throw new Error("useTooltip must be used within a TooltipProvider");
|
||||
throw new Error("useTooltip must be used within a TooltipProvider")
|
||||
}
|
||||
return context;
|
||||
};
|
||||
return context
|
||||
}
|
||||
|
||||
export default useTooltip;
|
||||
export default useTooltip
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { useContext } from "react";
|
||||
import { WebSocketContext } from "../context/websocket-context";
|
||||
import { useContext } from "react"
|
||||
|
||||
import { WebSocketContext } from "../context/websocket-context"
|
||||
|
||||
export const useWebSocketContext = () => {
|
||||
const context = useContext(WebSocketContext);
|
||||
const context = useContext(WebSocketContext)
|
||||
if (context === undefined) {
|
||||
throw new Error(
|
||||
"useWebSocketContext must be used within a WebSocketProvider",
|
||||
);
|
||||
throw new Error("useWebSocketContext must be used within a WebSocketProvider")
|
||||
}
|
||||
return context;
|
||||
};
|
||||
return context
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user