import { InjectionToken, inject } from '@angular/core';
import { environment } from '../../../../../environments/environment';
import { AdminDashboardMetricsGateway } from './admin-dashboard-metrics.gateway.interface';
import { AdminDashboardMetricsLocalGateway } from './admin-dashboard-metrics.local.gateway';
import { AdminDashboardMetricsApiGateway } from './admin-dashboard-metrics-api.gateway';

/** Swap point. */
export const ADMIN_DASHBOARD_METRICS_GATEWAY = new InjectionToken<AdminDashboardMetricsGateway>('ADMIN_DASHBOARD_METRICS_GATEWAY', {
  providedIn: 'root',
  factory: () => (environment.useMockData ? inject(AdminDashboardMetricsLocalGateway) : inject(AdminDashboardMetricsApiGateway)),
});
