import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';

/// A divider widget with centered text, typically used to separate
/// email/password auth from social auth headers.
///
/// Displays a horizontal line with text in the middle (e.g., "Or continue with").
class AuthDivider extends StatelessWidget {

  /// Creates an [AuthDivider].
  const AuthDivider({super.key, required this.text});
  /// The text to display in the center of the divider.
  final String text;

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        const Expanded(child: Divider()),
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: UiConstants.space4),
          child: Text(text, style: UiTypography.footnote1r.textSecondary),
        ),
        const Expanded(child: Divider()),
      ],
    );
  }
}
