import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

class ProfitIndicator extends StatelessWidget {
  final double profit;
  
  const ProfitIndicator({super.key, required this.profit});


  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.fromLTRB(0, 0, 20, 0),
      padding: const EdgeInsets.fromLTRB(10, 5, 10, 5),
      decoration: BoxDecoration(
        color: Theme.of(context).colorScheme.primaryContainer,
        borderRadius: BorderRadius.circular(5)
      ),
      child: Text(
        "Profit ${NumberFormat('#####00.00 €', 'fr_FR').format(profit)}",
        style: TextStyle(
          fontFamily: 'NovaMono',
          fontSize: 20,
          fontWeight: FontWeight.w500,
          color: profit > 0 ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.error
        ),
      )
    );
  }
}