2021-02-24 02:48:09 -05:00
|
|
|
import { Category } from '../config/categories-config';
|
2021-02-22 01:59:24 -05:00
|
|
|
import { intParamTransform } from './url-param-transform';
|
|
|
|
import { useUrlParam } from './use-url-param';
|
|
|
|
|
2021-02-24 02:48:09 -05:00
|
|
|
export function useUrlBuildingParam(defaultMode: 'view' | 'edit' | 'multi-edit', defaultCategory: Category | 'categories' = 'categories') {
|
2021-03-11 14:08:44 -05:00
|
|
|
return useUrlParam('building', intParamTransform, '/:mode/:category/:building?/(history)?', {mode: defaultMode, category: defaultCategory});
|
2021-02-22 01:59:24 -05:00
|
|
|
}
|