import 'package:ambito/src/widgets/buttons/cancel_button_with_action.dart';
import 'package:ambito/src/widgets/buttons/save_button.dart';
import 'package:flutter/material.dart';

import '../../packages/ambito_theme/ambito_theme.dart';

class SaveButtonsGroupWithCancelAction extends StatelessWidget {
  final VoidCallback onPressedCancel;
  final VoidCallback onPressedSave;

  const SaveButtonsGroupWithCancelAction(
      {super.key, required this.onPressedCancel, required this.onPressedSave});

  @override
  Widget build(BuildContext context) {
    final AmbitoTheme theme = getTheme(context);

    return Align(
      alignment: Alignment.centerRight,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          CancelButtonWithAction(onPressed: onPressedCancel),
          theme.horizontalSpacer,
          SaveButton(onPressed: onPressedSave),
        ],
      ),
    );
  }
}
