import 'package:flutter/material.dart';
import 'package:sigap/src/utils/constants/colors.dart';
import 'package:sigap/src/utils/constants/sizes.dart';
import 'package:sigap/src/utils/helpers/helper_functions.dart';

class AuthDivider extends StatelessWidget {
  final String text;

  const AuthDivider({
    Key? key,
    required this.text,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final isDark = THelperFunctions.isDarkMode(context);
    final dividerColor = isDark ? Colors.grey.shade700 : Colors.grey.shade300;

    return Row(
      children: [
        Expanded(
          child: Divider(
            color: dividerColor,
            thickness: 1.0,
          ),
        ),
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: TSizes.md),
          child: Text(
            text,
            style: Theme.of(context).textTheme.bodyMedium?.copyWith(
                  color: isDark ? TColors.textSecondary : Colors.grey.shade600,
                ),
          ),
        ),
        Expanded(
          child: Divider(
            color: dividerColor,
            thickness: 1.0,
          ),
        ),
      ],
    );
  }
}
