import { Badge } from "@/shared/common/ui/badge";
import { t } from "i18next";
//badge and the status mapped
export function renderStatus(param: string, type: string, onReview?: boolean) {
  switch (type) {
    case "Pending":
      return <Badge variant="secondary">{t("statusBar.Pending")}</Badge>;
    case "Draft":
      return <Badge variant="secondary">{t("statusBar.Draft")}</Badge>;
    case "not_assigned":
      return <Badge variant="secondary">{t("statusBar.not_assigned")}</Badge>;
    case "Team Signature":
      return (
        <Badge
          variant="secondary"
          style={{
            background: "#CC66DA",
            color: "white",
          }}
        >
          {t("statusBar.Team Signature")}
        </Badge>
      );
    case "draft":
      return <Badge variant="secondary">{t("statusBar.InProgress")}</Badge>;
    case "In Progress":
      if (onReview) {
        return (
          <Badge
            variant="secondary"
            style={{ backgroundColor: "#FFD700", color: "yellow" }}
          >
            {t("statusBar.Under Review")}
          </Badge>
        );
      }
      return <Badge variant="purple">{t("statusBar.InProgress")}</Badge>;
    case "active":
      if (onReview) {
        return <Badge variant="purple">{t("statusBar.Under Review")}</Badge>;
      }
      return <Badge variant="purple">{t("statusBar.InProgress")}</Badge>;
    case "Reassigned":
      return <Badge variant="danger2">{t("statusBar.Reassigned")}</Badge>;
    case "Re Assigned":
      return <Badge variant="danger2">{t("statusBar.Reassigned")}</Badge>;
    case "signed":
      return <Badge variant="success">{t("statusBar.signed")}</Badge>;
    case "re_assigned":
      return <Badge variant="danger2">{t("statusBar.Reassigned")}</Badge>;
    case "Approved":
      return <Badge variant="success">{t("statusBar.Approved")}</Badge>;
    case "assigned":
      return <Badge variant="success">{t("statusBar.assigned")}</Badge>;
    case "send_to_ro":
      return <Badge variant="success">{t("statusBar.Approved")}</Badge>;
    case "approve":
      return <Badge variant="success">{t("statusBar.Accepted")}</Badge>;
    case "approved":
      return <Badge variant="success">{t("statusBar.Accepted")}</Badge>;
    case "forwarded":
      return (
        <Badge variant="forward">{t("statusBar.Forwarded", "Forwarded")}</Badge>
      );
    case "Forwarded":
      return (
        <Badge variant="forward">{t("statusBar.Forwarded", "Forwarded")}</Badge>
      );
    case "Accepted":
      return <Badge variant="success">{t("statusBar.Accepted")}</Badge>;
    case "accepted":
      return <Badge variant="success">{t("statusBar.Accepted")}</Badge>;
    case "accept":
      return <Badge variant="success">{t("statusBar.Accepted")}</Badge>;
    case "yes":
      return <Badge variant="success">{t("statusBar.yes")}</Badge>;
    case "replied":
      return <Badge variant="success">{t("statusBar.replied")}</Badge>;
    case "Replied":
      return <Badge variant="success">{t("statusBar.replied")}</Badge>;
    case "Dispatched":
      return <Badge variant="success">{t("statusBar.Sent")}</Badge>;
    case "dispatched":
      return <Badge variant="success">{t("statusBar.Sent")}</Badge>;
    case "Adjustment":
      return <Badge variant="danger2">{t("statusBar.Adjustment")}</Badge>;
    case "Skipped":
      return <Badge variant="danger2">{t("statusBar.Skipped")}</Badge>;
    case "skipped":
      return <Badge variant="danger2">{t("statusBar.Skipped")}</Badge>;
    case "onReview":
      return <Badge variant="danger2">{t("statusBar.Under Review")}</Badge>;
    case "send_back":
      return <Badge variant="danger2">{t("statusBar.Returned")}</Badge>;
    case "sent_back":
      return <Badge variant="danger2">{t("statusBar.Returned")}</Badge>;
    case "returned":
      return <Badge variant="danger2">{t("statusBar.Returned")}</Badge>;
    case "adjustment":
      return <Badge variant="danger2">{t("statusBar.Adjustment")}</Badge>;
    case "adjustment_requested":
      return (
        <Badge variant="danger2">
          {t("statusBar.adjustment_requested", "Adjustment Requested")}
        </Badge>
      );
    case "send_back_by_ro":
      return <Badge variant="danger2">{t("statusBar.send_back_by_ro")}</Badge>;
    case "Rejected":
      return <Badge variant="danger">{t("statusBar.Rejected")}</Badge>;
    case "expired":
      return <Badge variant="danger">{t("statusBar.Expired")}</Badge>;
    case "Team Rejected":
      return <Badge variant="danger">{t("statusBar.Team Adjusted")}</Badge>;
    case "reject":
      return <Badge variant="danger">{t("statusBar.Rejected")}</Badge>;
    case "terminated":
      return <Badge variant="danger">{t("statusBar.terminated")}</Badge>;
    case "no":
      return <Badge variant="danger">{t("statusBar.no")}</Badge>;
    case "rejected":
      return <Badge variant="danger">{t("statusBar.Rejected")}</Badge>;
    case "team_rejected":
      return (
        <Badge variant="danger2">
          {t("statusBar.teamRejected", "Team Rejected")}
        </Badge>
      );
    case "commented":
      return (
        <Badge variant="secondary">
          {t("statusBar.commented", "Commented")}
        </Badge>
      );
    case "Submitted":
      return <Badge variant="purple">{t("statusBar.Submitted")}</Badge>;
    case "activated":
      return <Badge variant="success">{t("statusBar.activated")}</Badge>;
    case "deactivated":
      return <Badge variant="danger">{t("statusBar.deactivated")}</Badge>;
    case "ended":
      return <Badge variant="secondary">{t("statusBar.ended")}</Badge>;
    case "level_skipped":
      return <Badge variant="purple">{t("statusBar.Skipped")}</Badge>;
    default:
      return <Badge variant="secondary">{t(`statusBar.${param}`)}</Badge>;
  }
}
