import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:syncrow_web/pages/analytics/modules/analytics/enums/analytics_page_tab.dart';

part 'analytics_tab_event.dart';

class AnalyticsTabBloc extends Bloc<AnalyticsTabEvent, AnalyticsPageTab> {
  AnalyticsTabBloc() : super(AnalyticsPageTab.energyManagement) {
    on<UpdateAnalyticsTabEvent>(_onUpdateAnalyticsTabEvent);
  }

  void _onUpdateAnalyticsTabEvent(
    UpdateAnalyticsTabEvent event,
    Emitter<AnalyticsPageTab> emit,
  ) {
    emit(event.analyticsTab);
  }
}
