Skip to content

Commit

Permalink
feat(game): add processed status to games
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Nov 1, 2023
1 parent 026516e commit 0b1bfe8
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 175 deletions.
23 changes: 22 additions & 1 deletion src/lib/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FootballPositionIds } from "./constants";
import { ReactNode } from "react";
import React from "react";
import { toast } from "react-toastify";
import { UserOutlined, DownloadOutlined, SyncOutlined, CheckCircleOutlined, ClockCircleOutlined } from "@ant-design/icons";

declare type RowToPos = {
rowNumber: number,
Expand Down Expand Up @@ -126,4 +127,24 @@ export const openSuccessNotification = (config: NotificationConfig) => {
{config.message}
</React.Fragment>
));
};
};

export const statusToIconColor = (status: string) => {
switch (status) {
case "PLAYED":
return { color: "purple", icon: <UserOutlined /> };
break;
case "STATS_IMPORTED":
return { color: "warning", icon: <DownloadOutlined /> };
break;
case "STATS_UPDATED":
return { color: "processing", icon: <SyncOutlined spin /> };
break;
case "VALIDATED":
return { color: "success", icon: <CheckCircleOutlined /> };
break;
default:
return { color: "error", icon: <ClockCircleOutlined /> };
break;
}
}
Loading

0 comments on commit 0b1bfe8

Please sign in to comment.