import 'package:cargocalculaterapp/core/functions/base_finctions.dart';
import 'package:cargocalculaterapp/core/theme/app_text_styles.dart';
import 'package:cargocalculaterapp/core/theme/colors/app_colors.dart';
import 'package:cargocalculaterapp/core/utils/app_utils.dart';
import 'package:flutter/material.dart';

import '../../../../../constants/constants.dart';

class StatusWidget extends StatelessWidget {
  const StatusWidget({super.key, required this.status});

  final String status;

  @override
  Widget build(BuildContext context) {
    switch (status) {
      case AppConst.waiting:
        {
          return Container(
            padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
            decoration: const BoxDecoration(
              borderRadius: AppUtils.kBorderRadius24,
              color: ThemeColors.warningSurface,
            ),
            child: Text(
              Functions.getTranslatedItem(
                AppConst.statusList[AppConst.waiting],
                context,
              ),
              style: AppTextStyles.status.copyWith(color: ThemeColors.warning),
            ),
          );
        }
      case AppConst.shipped:
        {
          return Container(
            padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
            decoration: const BoxDecoration(
              borderRadius: AppUtils.kBorderRadius24,
              color: ThemeColors.green173Light,
            ),
            child: Text(
              Functions.getTranslatedItem(
                AppConst.statusList[AppConst.shipped],
                context,
              ),
              style: AppTextStyles.status,
            ),
          );
        }
      case AppConst.leftChine:
        {
          return Container(
            padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
            decoration: const BoxDecoration(
              borderRadius: AppUtils.kBorderRadius24,
              color: ThemeColors.green191Light,
            ),
            child: Text(
              Functions.getTranslatedItem(
                AppConst.statusList[AppConst.leftChine],
                context,
              ),
              style: AppTextStyles.status.copyWith(
                color: ThemeColors.green191text,
              ),
            ),
          );
        }
      default:
        {
          return Container(
            padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
            decoration: const BoxDecoration(
              borderRadius: AppUtils.kBorderRadius24,
              color: ThemeColors.green173Light,
            ),
            child: Text(
              Functions.getTranslatedItem(
                AppConst.statusList[status],
                context,
              ),
              style: AppTextStyles.status,
            ),
          );
        }
    }
  }
}
