mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-02 00:50:09 +00:00
20 lines
287 B
TypeScript
20 lines
287 B
TypeScript
'use client';
|
|
|
|
import { usePathname } from 'next/navigation';
|
|
|
|
export function useCurrentPathMeta() {
|
|
const pathname = usePathname();
|
|
|
|
if (!pathname) {
|
|
return {};
|
|
}
|
|
|
|
const [, , , packageName, version, item] = pathname.split('/');
|
|
|
|
return {
|
|
packageName,
|
|
version,
|
|
item,
|
|
};
|
|
}
|