import { Component, OnInit } from '@angular/core';
import { ThemeService } from './services/theme.service';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})

export class AppComponent implements OnInit {
  themeClass = 'light-theme';

  constructor(private themeService: ThemeService) {}

  ngOnInit() {
    this.themeService.isDarkTheme.subscribe((isDark) => {
      this.themeClass = isDark ? 'dark-theme' : 'light-theme';
      console.log('Theme class updated:', this.themeClass);
    });
  }

  toggleTheme() {
    this.themeService.toggleDarkTheme();
  }
}