mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 13:43:39 +01:00
13 lines
392 B
TypeScript
13 lines
392 B
TypeScript
import { useCallback } from 'react';
|
|
import { useParams, useSearchParams } from 'react-router-dom';
|
|
import type { RouteParamsRequest } from './useAppRoutes';
|
|
|
|
export function useActiveEnvironmentId(): string | null {
|
|
const { environmentId } = useParams<RouteParamsRequest>();
|
|
if (environmentId == null || environmentId === '__default__') {
|
|
return null;
|
|
}
|
|
|
|
return environmentId;
|
|
}
|