import { inject } from '@angular/core';
import { ResolveFn } from '@angular/router';
import { take } from 'rxjs/operators';

import { CanopiesPageData } from '@models';
import { PagesService } from '@services';

export const canopiesPageResolver: ResolveFn<CanopiesPageData> = () => {
    return inject(PagesService).getCanopiesPage().pipe(take(1));
};