import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';

class ChartInformativeCell extends StatelessWidget {
  const ChartInformativeCell({
    super.key,
    required this.title,
    required this.color,
    this.hasBorder = false,
    this.height,
  });

  final Widget title;
  final Color color;
  final bool hasBorder;
  final double? height;

  @override
  Widget build(BuildContext context) {
    return Container(
      height: height ?? MediaQuery.sizeOf(context).height * 0.0385,
      padding: const EdgeInsetsDirectional.symmetric(
        vertical: 8,
        horizontal: 12,
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadiusDirectional.circular(8),
        border: Border.all(
          color: ColorsManager.greyColor,
          width: 1,
        ),
      ),
      child: FittedBox(
        fit: BoxFit.scaleDown,
        alignment: Alignment.center,
        child: Row(
          spacing: 6,
          children: [
            Container(
              height: 8,
              width: 8,
              decoration: BoxDecoration(
                color: color,
                border: Border.all(color: ColorsManager.grayBorder),
                shape: BoxShape.circle,
              ),
            ),
            DefaultTextStyle(
              style: const TextStyle(
                color: ColorsManager.blackColor,
                fontWeight: FontWeight.w400,
                fontSize: 14,
              ),
              child: title,
            ),
          ],
        ),
      ),
    );
  }
}
