import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:krow/core/presentation/styles/kw_text_styles.dart';
import 'package:krow/core/presentation/styles/theme.dart';
import 'package:krow/features/earning/domain/entities/earning_shift_entity.dart';

class EarnedShiftStatusLabelWidget extends StatefulWidget {
  final EarningShiftEntity viewModel;

  const EarnedShiftStatusLabelWidget(this.viewModel, {super.key});

  @override
  State<EarnedShiftStatusLabelWidget> createState() =>
      _EarnedShiftStatusLabelWidgetState();
}

class _EarnedShiftStatusLabelWidgetState
    extends State<EarnedShiftStatusLabelWidget> {
  Color getColor() {
    return AppColors.bgColorDark;
    // switch (widget.viewModel.status) {
    //   case EventShiftRoleStaffStatus.assigned:
    //     return AppColors.primaryBlue;
    //   case EventShiftRoleStaffStatus.confirmed:
    //     return AppColors.statusWarning;
    //   case EventShiftRoleStaffStatus.ongoing:
    //     return AppColors.statusSuccess;
    //   case EventShiftRoleStaffStatus.completed:
    //     return AppColors.bgColorDark;
    //   case EventShiftRoleStaffStatus.canceledByAdmin:
    //   case EventShiftRoleStaffStatus.canceledByBusiness:
    //   case EventShiftRoleStaffStatus.canceledByStaff:
    //   case EventShiftRoleStaffStatus.requestedReplace:
    //     return AppColors.statusError;
    // }
  }

  String getText() {
    return 'completed'.tr();
    // switch (widget.viewModel.status) {
    //   case EventShiftRoleStaffStatus.assigned:
    //     return _getAssignedAgo();
    //   case EventShiftRoleStaffStatus.confirmed:
    //     return _getStartIn();
    //   case EventShiftRoleStaffStatus.ongoing:
    //     return 'Ongoing';
    //   case EventShiftRoleStaffStatus.completed:
    //     return 'Completed';
    //   case EventShiftRoleStaffStatus.canceledByAdmin:
    //   case EventShiftRoleStaffStatus.canceledByBusiness:
    //   case EventShiftRoleStaffStatus.canceledByStaff:
    //   case EventShiftRoleStaffStatus.requestedReplace:
    //     return 'Canceled';
    // }
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 24,
      padding: const EdgeInsets.symmetric(horizontal: 8),
      decoration: BoxDecoration(
        color: getColor(),
        borderRadius: BorderRadius.circular(12),
      ),
      child: Center(
        child: Text(
          getText(),
          style: AppTextStyles.bodySmallMed
              .copyWith(color: AppColors.grayWhite, height: 0.7),
        ),
      ),
    );
  }
}
