diff --git a/src/components/InfiniteLoad/ExerciseRow.tsx b/src/components/InfiniteLoad/ExerciseRow.tsx index 75eb24e..7c3ad69 100644 --- a/src/components/InfiniteLoad/ExerciseRow.tsx +++ b/src/components/InfiniteLoad/ExerciseRow.tsx @@ -9,6 +9,7 @@ import { CategoryDifficulties } from "../CategoryDifficulties"; import { KaTeX } from "../Katex"; import { StyledTableRow } from "@/components/StyledTableRow.tsx"; import dayjs from "dayjs"; +import { exerciseStatusToHuman } from "@/util/const.ts"; const ExerciseRow: FC<{ data: ExerciseListElemFragment }> = ({ data }) => { const navigate = useNavigate(); @@ -37,7 +38,13 @@ const ExerciseRow: FC<{ data: ExerciseListElemFragment }> = ({ data }) => { - {data.status} + + + {data.tags.map((tag, index) => ( diff --git a/src/util/const.ts b/src/util/const.ts index 57fdbc2..d995420 100644 --- a/src/util/const.ts +++ b/src/util/const.ts @@ -2,6 +2,7 @@ import { Exercise, ExerciseAgeGroup, ExerciseCheckType, + ExerciseStatus, } from "@/generated/graphql"; import { ExerciseFieldsType, ExerciseQuery } from "./types"; @@ -114,3 +115,35 @@ export const createExerciseInitialValue: ExerciseFieldsType = { tags: [], sameLogicGroup: "", }; + +export const exerciseStatusToHuman: Record< + ExerciseStatus, + { + color: + | "primary" + | "default" + | "secondary" + | "error" + | "info" + | "success" + | "warning"; + text: string; + } +> = { + APPROVED: { + color: "success", + text: "Kész", + }, + CREATED: { + color: "default", + text: "Beküldve", + }, + DELETED: { + color: "error", + text: "Törölve", + }, + DRAFT: { + color: "warning", + text: "Vázlat", + }, +};