import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:flutter/material.dart';

class BackButtonView extends StatelessWidget {
  final EdgeInsets? margin;
  final void Function()? onPress;
  const BackButtonView({super.key, this.margin, this.onPress});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: margin ?? EdgeInsets.all(0),
      width: SizeConfig.width * 0.1,
      child: IconButton(
          style: IconButton.styleFrom(
              backgroundColor: Colors.white,
              shape: const CircleBorder(
                  side: BorderSide(color: ColorPalette.slate200)
              )
          ),
          onPressed: onPress ?? () => Navigator.pop(context),
          icon: const Icon(Icons.arrow_back)
      ),
    );
  }
}
