import 'package:ambito/src/extensions/extensions.dart';
import 'package:flutter/material.dart';

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

class CancelButton extends StatelessWidget {
  const CancelButton({super.key});

  @override
  Widget build(BuildContext context) {
    final AmbitoTheme theme = getTheme(context);
    return WidgetOutlineButton(
      onPressed: () {
        Navigator.pop(context);
      },
      title: context.translate('page.general.buttons.cancel'),
      backgroundColor: theme.currentColorScheme.tertiary,
      foregroundColor: theme.currentColorScheme.error,
      borderColor: theme.currentColorScheme.error,
    );
  }
}
