import 'package:flutter/material.dart';
import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart';
import 'package:syncrow_app/features/shared_widgets/united_text.dart';
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';

import 'package:syncrow_app/generated/assets.dart';

class Consumption extends StatelessWidget {
  const Consumption({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(right: 20, left: 20, top: 10, bottom: 10),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(20),
      ),
      constraints: const BoxConstraints(
        minHeight: 80,
        maxHeight: 100,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              const CardTitle(
                title: StringsManager.ACConsumption,
              ),
              const Spacer(),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  UnitedText(
                    value: "2",
                    valueSize: MediaQuery.sizeOf(context).height.ceil() > 680
                        ? 35
                        : 24,
                    valueWeight: FontWeight.normal,
                    unit: "Units",
                  ),
                  const SizedBox(width: 30),
                  UnitedText(
                    value: "${MediaQuery.sizeOf(context).height.ceil()}",
                    valueSize: MediaQuery.sizeOf(context).height.ceil() > 680
                        ? 35
                        : 24,
                    valueWeight: FontWeight.normal,
                    unit: "kWh",
                  ),
                ],
              ),
              const Spacer(),
            ],
          ),
          //TODO: Replace with actual pie chart
          SizedBox.square(
            dimension: 60,
            child: Image.asset(
              Assets.assetsImagesTestDash2,
              fit: BoxFit.contain,
            ),
          )
        ],
      ),
    );
  }
}
