import { TuiRoot } from '@taiga-ui/core';
import {Component, inject, OnInit, signal} from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { environment as env } from '../environments/environment';
import {environment, SDKConfig} from '@chatenium/chatenium-sdk/core/environment';
import {IndexedDB} from './storage/indexed-db';

@Component({
  selector: 'app-root',
  imports: [RouterOutlet, TuiRoot],
  templateUrl: './app.html',
  styleUrl: './app.scss',
})
export class App implements OnInit {
  indexedDb = inject(IndexedDB)

  protected readonly title = signal('Chatenium-On-Web');

  ngOnInit() {
    environment.overwrite(<SDKConfig>{
      cdnUrl: env.cdn_url,
      apiUrl: env.api_url,
      wsUrl: env.ws_url,
    });
  }
}
