import 'package:flutter/material.dart';

import '../extensions/num_extension.dart';
import '../resouce/base_color.dart';

class PriceTagWidget extends StatelessWidget {
  final int point;

  const PriceTagWidget({super.key, required this.point});

  bool get isFree => point == 0;

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 26,
      padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
      decoration: BoxDecoration(
        color: BaseColor.primary150,
        borderRadius: BorderRadius.circular(13),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Image.asset('assets/images/ic_point.png', width: 16, height: 16),
          const SizedBox(width: 4),
          Text(
            isFree ? 'Miễn phí' : point.money(CurrencyUnit.none),
            style: TextStyle(
              fontSize: 12,
              color: Colors.black,
              fontWeight: FontWeight.bold,
            ),
          ),
        ],
      ),
    );
  }
}
