// lib/app/widgets/divider_with_text.dart
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nomo/config/theme/theme_extensions/theme_extension.dart';

class DividerWithText extends StatelessWidget {
  final String text;
  final double height;
  final Color? dividerColor;
  final Color? textColor;
  final double dividerThickness;
  final EdgeInsets padding;

  const DividerWithText({
    super.key,
    this.text = 'Or',
    this.height = 16.0,
    this.dividerColor,
    this.textColor,
    this.dividerThickness = 1.0,
    this.padding = const EdgeInsets.symmetric(horizontal: 24.0),
  });

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: padding,
      child: Row(
        children: [
          Expanded(
            child: Divider(
              height: height,
              thickness: dividerThickness,
              color: dividerColor ?? Get.reactiveTheme.dividerColor,
            ),
          ),
          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 16.0),
            child: Text(
              text,
              style: TextStyle(
                color:
                    textColor ?? Get.reactiveTheme.textTheme.bodyLarge!.color,
                fontSize: 14,
              ),
            ),
          ),
          Expanded(
            child: Divider(
              height: height,
              thickness: dividerThickness,
              color: dividerColor ?? Colors.grey[400],
            ),
          ),
        ],
      ),
    );
  }
}
