Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Bailey Pumfleet <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Hariom Balhara <[email protected]>
10 lines
203 B
TypeScript
10 lines
203 B
TypeScript
import { useSearchParams } from "next/navigation";
|
|
|
|
export function useToggleQuery(name: string) {
|
|
const searchParams = useSearchParams();
|
|
|
|
return {
|
|
isOn: searchParams?.get(name) === "1",
|
|
};
|
|
}
|