Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Bailey Pumfleet <bailey@pumfleet.co.uk> Co-authored-by: Peer Richelsen <peer@cal.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
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",
|
|
};
|
|
}
|