chore: heygermany customer project
Some checks failed
Main / Setup and Test (push) Has been cancelled
Main / Build Website (push) Has been cancelled

This commit is contained in:
e2e
2026-07-11 09:36:03 +02:00
commit 1e78e21c36
398 changed files with 38345 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
'use client'
import {
useLocation,
useNavigate,
useParams as useRouteParams,
useRouter as useTanStackRouter,
} from '@tanstack/react-router'
type RouteParams = Record<string, string | string[] | undefined>
export const useRouter = () => {
const navigate = useNavigate()
const router = useTanStackRouter()
return {
push: (to: string) => navigate({ to }),
replace: (to: string) => navigate({ to, replace: true }),
refresh: () => router.invalidate(),
}
}
export const usePathname = () => useLocation({ select: (location) => location.pathname })
export const useSearchParams = () =>
useLocation({
select: (location) => new URLSearchParams(location.searchStr),
})
export const useParams = <T extends RouteParams = RouteParams>(): T => {
const params = useRouteParams({ strict: false })
return params as T
}