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

class FlexibleItemWidget extends StatelessWidget {
  final String prodType;
  final int count;

  const FlexibleItemWidget({
    Key? key,
    required this.prodType,
    required this.count,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
      decoration: BoxDecoration(
        color: ColorsManager.textFieldGreyColor,
        borderRadius: BorderRadius.circular(8),
        border: Border.all(color: ColorsManager.transparentColor),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          SvgPicture.asset(
            prodType,
            width: 15,
            height: 16,
          ),
          const SizedBox(width: 4),
          Text(
            'x$count',
            style: Theme.of(context)
                .textTheme
                .bodySmall
                ?.copyWith(color: ColorsManager.spaceColor),
          ),
        ],
      ),
    );
  }
}
