import 'package:flutter/material.dart';
import 'package:iconsax/iconsax.dart';
import 'package:sigap/src/shared/widgets/text/title_text.dart';
import 'package:sigap/src/utils/constants/colors.dart';
import 'package:sigap/src/utils/constants/enums.dart';
import 'package:sigap/src/utils/constants/sizes.dart';

class TitleWithVerified extends StatelessWidget {
  const TitleWithVerified({
    super.key,
    required this.title,
    this.maxLines = 1,
    this.textAlign = TextAlign.center,
    this.textSizes = TextSizes.small,
    this.textColor,
    this.iconColor = TColors.primary,
    this.showIcon = true,
  });

  final String title;
  final int maxLines;
  final TextAlign? textAlign;
  final TextSizes textSizes;
  final Color? textColor, iconColor;
  final bool showIcon;

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        Flexible(
          child: TitleText(
            title: title,
            color: textColor,
            textAlign: textAlign,
            maxLines: maxLines,
            textSizes: textSizes,
          ),
        ),
        const SizedBox(width: TSizes.xs),
        if (showIcon)
          Icon(Iconsax.verify5, color: iconColor, size: TSizes.iconXs),
      ],
    );
  }
}
