import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';

class StatusLabel extends StatelessWidget {
  const StatusLabel({
    Key? key,
    this.stepId = 0,
    this.selectedStepId = 0,
  }) : super(key: key);

  final int stepId;
  final int selectedStepId;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5,
      padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
      decoration: BoxDecoration(
        color: stepId == selectedStepId
            ? Color(0xFFF1E9D3)
            : stepId < selectedStepId
                ? Color(0xFFD8E8DB)
                : Color(0xFFCCCCCC),
        borderRadius: BorderRadius.all(
          Radius.circular(5.0),
        ),
        border: Border.all(color: HexColor('#707070'), width: 0.30),
      ),
      child: Center(
        child: AppText(
          stepId == selectedStepId
              ? TranslationBase.of(context).inProgress
              : stepId < selectedStepId
                  ? TranslationBase.of(context).completed
                  : TranslationBase.of(context).locked,
          fontWeight: FontWeight.bold,
          textAlign: TextAlign.center,
          fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
          color: stepId == selectedStepId
              ? Color(0xFFCC9B14)
              : stepId < selectedStepId
                  ? AppGlobal.appGreenColor
                  : Color(0xFF969696),
        ),
      ),
    );
  }
}
