import 'package:flutter/material.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';

class UnitedText extends StatelessWidget {
  const UnitedText({
    super.key,
    required this.value,
    required this.unit,
    this.valueStyle,
    this.unitStyle,
    this.valueSize,
    this.valueWeight,
    this.valueColor,
    this.unitSize,
    this.unitWeight,
    this.unitColor,
  });

  final String value;

  final TextStyle? valueStyle;
  final double? valueSize;
  final FontWeight? valueWeight;

  final Color? valueColor;
  final String unit;

  final TextStyle? unitStyle;
  final double? unitSize;
  final FontWeight? unitWeight;
  final Color? unitColor;

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.end,
      crossAxisAlignment: CrossAxisAlignment.baseline,
      textBaseline: TextBaseline.alphabetic,
      children: [
        BodyLarge(
          text: value,
          style: valueStyle ??
              TextStyle(
                fontSize: valueSize ?? 20,
                fontWeight: valueWeight ?? FontWeight.bold,
                color: valueColor,
                height: 0,
              ),
        ),
        BodySmall(
          text: unit,
          style: unitStyle ??
              TextStyle(
                fontSize: unitSize ?? 10,
                fontWeight: unitWeight,
                color: unitColor,
              ),
        ),
      ],
    );
  }
}
