Files
2026-07-13 12:38:34 +08:00

13 lines
332 B
TypeScript

'use client';
import { usePathname } from 'next/navigation';
import { detectApiVersion, type ApiVersion } from './api-version';
/**
* Client hook that returns the current API version based on the URL path.
*/
export function useApiVersion(): ApiVersion {
const pathname = usePathname();
return detectApiVersion(pathname);
}