You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
2.1 KiB

  1. export function getStatus(params) {
  2. switch (params.row.status) {
  3. case "submitted":
  4. return getStatusTag({ color: "#f5a83d", text: "已提交" })
  5. case "rejected":
  6. return getStatusTag({ color: "#d9372b", text: "已拒絕" })
  7. case "cancelled":
  8. return getStatusTag({ color: "#757373", text: "已取消" })
  9. case "accepted":
  10. return getStatusTag({ color: "#22a13f", text: "已接受" })
  11. case "confirmed":
  12. return getStatusTag({ color: "#22a13f", text: "已確認" })
  13. case "paid":
  14. return getStatusTag({ color: "#22a13f", text: "已付費" })
  15. case "published":
  16. return getStatusTag({ color: "#f5a83d", text: "已發表" })
  17. case "withdrawn":
  18. return getStatusTag({ color: "#8a8784", text: "已撤銷" })
  19. default:
  20. return getStatusTag({ text: params.row.status })
  21. }
  22. }
  23. export function getStatusEng(params) {
  24. switch (params.row.status) {
  25. case "submitted":
  26. return getStatusTag({ color: "#f5a83d", text: "Submitted" })
  27. case "rejected":
  28. return getStatusTag({ color: "#d9372b", text: "Rejected" })
  29. case "cancelled":
  30. return getStatusTag({ color: "#757373", text: "Cancelled" })
  31. case "accepted":
  32. return getStatusTag({ color: "#22a13f", text: "Accepted" })
  33. case "confirmed":
  34. return getStatusTag({ color: "#22a13f", text: "Confirmed" })
  35. case "paid":
  36. return getStatusTag({ color: "#22a13f", text: "Paid" })
  37. case "published":
  38. return getStatusTag({ color: "#f5a83d", text: "Published" })
  39. case "withdrawn":
  40. return getStatusTag({ color: "#8a8784", text: "Withdrawn" })
  41. default:
  42. return getStatusTag({ text: params.row.status })
  43. }
  44. }
  45. export function getStatusTag({ color = "#000", textColor = "#FFF", text = "" }) {
  46. return (
  47. <div style={{ "border-radius": "25px", "background": color, "color": textColor, "padding": "5px 10px 5px 10px" }}><b>{text}</b></div>
  48. )
  49. }