import 'package:flutter/material.dart';


class DialogSubmitButton extends StatelessWidget {
  final String label;
  final bool isSaving;
  final VoidCallback onSubmit;

  const DialogSubmitButton({
    super.key,
    required this.label,
    required this.isSaving,
    required this.onSubmit,
  });

  @override
  Widget build(BuildContext context) => ElevatedButton(
    onPressed: isSaving ? null : onSubmit,
    child: isSaving
      ? const SizedBox(
          width: 18,
          height: 18,
          child: CircularProgressIndicator(strokeWidth: 2),
        )
      : Text(label),
  );
}
