import { ResolveFn, Router } from '@angular/router';
import { inject } from '@angular/core';
import { Profile } from '@app/domain/profiles/profile.model';
import { User } from '@app/domain/users/user.model';

export const detailResolver: ResolveFn<{ user: User; profile: Profile }> = (route, state) => {
  const paramValue = route.params['name'];
  const router = inject(Router);
  return router.getCurrentNavigation()?.extras.state as { user: User; profile: Profile };
};
