colouring-montreal/app/src/frontend/nav/use-url-building-param.ts
2021-03-11 19:08:44 +00:00

8 lines
450 B
TypeScript

import { Category } from '../config/categories-config';
import { intParamTransform } from './url-param-transform';
import { useUrlParam } from './use-url-param';
export function useUrlBuildingParam(defaultMode: 'view' | 'edit' | 'multi-edit', defaultCategory: Category | 'categories' = 'categories') {
return useUrlParam('building', intParamTransform, '/:mode/:category/:building?/(history)?', {mode: defaultMode, category: defaultCategory});
}