mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 11:55:51 -05:00
15 lines
456 B
TypeScript
15 lines
456 B
TypeScript
import { useLocation, useParams } from '@tanstack/react-router';
|
|
import type { RouteSlotData } from '@/extensions/registry';
|
|
import { routeParamStrings } from '@/router/params';
|
|
|
|
export const useRouteSlotData = (): RouteSlotData => {
|
|
const location = useLocation();
|
|
const params = useParams({ strict: false });
|
|
|
|
return {
|
|
pathname: location.pathname,
|
|
search: location.search,
|
|
params: routeParamStrings(params),
|
|
};
|
|
};
|