import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../blocs/emergency_contact_bloc.dart';

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

  @override
  Widget build(BuildContext context) {
    return Center(
      child: TextButton.icon(
        onPressed: () =>
            context.read<EmergencyContactBloc>().add(EmergencyContactAdded()),
        icon: Icon(UiIcons.add, size: 20.0),
        label: Text(
          'Add Another Contact',
          style: UiTypography.title2b,
        ),
        style: TextButton.styleFrom(
          foregroundColor: UiColors.primary,
          padding: EdgeInsets.symmetric(
            horizontal: UiConstants.space6,
            vertical: UiConstants.space3,
          ),
          shape: RoundedRectangleBorder(
            borderRadius: UiConstants.radiusFull,
            side: BorderSide(color: UiColors.primary),
          ),
        ),
      ),
    );
  }
}
