mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 03:45:53 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
12 lines
429 B
TypeScript
12 lines
429 B
TypeScript
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
import { getRouteApi } from '@tanstack/react-router';
|
|
import { type AdminEgg, adminEggQueryOptions } from '@/api/admin/eggs/queries';
|
|
|
|
const eggDetailRoute = getRouteApi('/authenticated/panel/eggs/$eggId');
|
|
|
|
export const useEggDetail = (): AdminEgg => {
|
|
const { eggId } = eggDetailRoute.useParams();
|
|
|
|
return useSuspenseQuery(adminEggQueryOptions(eggId)).data;
|
|
};
|