import 'package:flutter/material.dart';

class TelegramLoginButton extends StatelessWidget {
  const TelegramLoginButton({
    required this.onPressed,
    required this.loading,
    super.key,
  });

  final VoidCallback? onPressed;
  final bool loading;

  @override
  Widget build(BuildContext context) {
    return FilledButton.icon(
      onPressed: loading ? null : onPressed,
      icon: loading
          ? const SizedBox.square(
              dimension: 18,
              child: CircularProgressIndicator(strokeWidth: 2),
            )
          : const Icon(Icons.telegram),
      label: const Text('Войти через Telegram'),
    );
  }
}
