import { useQuery } from '@tanstack/react-query';
import { useSeamClient } from '../../../../lib/seam/use-seam-client.js';
export function useDeviceModel(params) {
    const normalizedParams = typeof params === 'string' ? { device_model_id: params } : params;
    const { client: seam } = useSeamClient();
    const { data, ...rest } = useQuery({
        enabled: seam != null,
        queryKey: ['internal', 'device_models', 'get', normalizedParams],
        queryFn: async () => {
            if (seam == null)
                return null;
            const { data: { device_model: deviceModel }, } = await seam.client.get('/internal/devicedb/v1/device_models/get', { params: normalizedParams });
            return deviceModel;
        },
    });
    return {
        ...rest,
        // @ts-expect-error: Upstream mismatch between type and route type.
        deviceModel: data,
    };
}
//# sourceMappingURL=use-device-model.js.map