import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { BootstrapConfig } from '../../../shared/models/config';
import { ConfigProvider } from '../../config/config-provider.interface';

@Injectable({ providedIn: 'root' })
export class MockBootstrapProvider implements ConfigProvider {
  private readonly bootstrapUrl = '/assets/mock/bootstrap/bootstrap.json';

  constructor(private readonly http: HttpClient) {}

  loadBootstrap(): Observable<BootstrapConfig> {
    return this.http.get<BootstrapConfig>(this.bootstrapUrl);
  }
}
