import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';

class PowerClampInfoCard extends StatelessWidget {
  final String iconPath;
  final String title;
  final String value;
  final String unit;

  const PowerClampInfoCard({
    Key? key,
    required this.iconPath,
    required this.title,
    required this.value,
    required this.unit,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: DefaultContainer(
        height: 55,
        color: ColorsManager.grayBox,
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Expanded(
              child: SvgPicture.asset(
                iconPath,
                fit: BoxFit.contain,
              ),
            ),
            Expanded(
              flex: 3,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  BodyMedium(
                    fontWeight: FontWeight.w400,
                    fontSize: 8,
                    text: title,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      BodyMedium(
                        fontWeight: FontWeight.w700,
                        fontSize: 15,
                        text: value,
                      ),
                      BodyMedium(
                        fontWeight: FontWeight.w700,
                        fontSize: 8,
                        text: unit,
                      ),
                    ],
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
