import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/domain/models/bookable_space_model.dart';
import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/presentation/blocs/steps_cubit/cubit/steps_cubit.dart';
import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/presentation/widgets/buttons_divider_bottom_dialog_widget.dart';

class NextFirstStepButton extends StatelessWidget {
  final List<BookableSpacemodel> selectedSpaces;

  const NextFirstStepButton({
    super.key,
    required this.selectedSpaces,
  });

  @override
  Widget build(BuildContext context) {
    return ButtonsDividerBottomDialogWidget(
      title: 'Next',
      onNextPressed: selectedSpaces.isEmpty
          ? null
          : () {
              context.read<StepsCubit>().goToNextStep();
            },
      onCancelPressed: () => context.pop(),
    );
  }
}
