import Route from 'route-parser';
// const appRoute = '/:spaceId(/:membershipId)(/:viewId)';
const activateMembershipRoute = '/:spaceId(/:membershipConfigId)(/:membershipId)(/:viewId)';
export function getRouteParams(pathname) {
  // console.log('getRouteParams', pathname, new Route(activateMembershipRoute).match(pathname));
  return new Route(activateMembershipRoute).match(pathname);
}
export function getActivateMembershipRouteParams(pathname) {
  return new Route(activateMembershipRoute).match(pathname);
}
export function buildRoute(spaceId, membershipConfigId, membershipId, viewId) {
  // console.log(new Route(appRoute).reverse({ spaceId, membershipId, viewId }));
  // console.log({ spaceId, membershipConfigId, membershipId, viewId });
  return new Route(activateMembershipRoute).reverse({ spaceId, membershipConfigId, membershipId, viewId });
}
// export function navigate(path: string) {
//   history.pushState({}, null, path);
// }
// export function redirect(path: string) {
// history.pushState({}, null, path)
// location.pathname = path;
// }
