diff --git a/src/Pages/Admin/QuestionBank/useTableColumns.tsx b/src/Pages/Admin/QuestionBank/useTableColumns.tsx index 9bbac06..632669b 100644 --- a/src/Pages/Admin/QuestionBank/useTableColumns.tsx +++ b/src/Pages/Admin/QuestionBank/useTableColumns.tsx @@ -45,19 +45,59 @@ export const useColumns = () => { }, { title: `${t("columns.content")}`, - dataIndex: "name", - key: "name", + dataIndex: "content", + key: "content", align: "center", render: (text, record) => record?.content, ellipsis: true, }, { - title: t("columns.isBase"), + title: `${t("columns.hint")}`, + dataIndex: "hint", + key: "hint", + align: "center", + render: (text, record) => { + + return ( + <>{record?.hint ?? "karim"} + ); + }, + ellipsis: true, + }, + { + title: `${t("columns.tags")}`, + dataIndex: "tags", + key: "tags", + align: "center", + + render: (text, record) => { + const tags = record?.tags?.map((item:any)=>{ + return item?.name + }) ?? []; + return ( +
+ {tags.length > 0 ? ( + tags.map((tag, index) => ( + + {tag} + {index < tags.length - 1 && ', '} + + )) + ) : ( + _ + )} +
+ ); + }, + ellipsis: true, + }, + { + title: t("columns.question_type"), dataIndex: "isBase", key: "isBase", align: "center", render: (text, record) => - record?.isBase ? t("practical.yes") : t("practical.no"), + record?.isBase ? t("columns.base_question") : t("columns.normal_question"), }, { @@ -66,7 +106,6 @@ export const useColumns = () => { align: "center", render: (_text, record, index) => { - return ( { }, { title: `${t("columns.content")}`, - dataIndex: "name", - key: "name", + dataIndex: "content", + key: "content", align: "center", render: (text, record) => record?.content, ellipsis: true, }, { - title: t("columns.isBase"), + title: `${t("columns.hint")}`, + dataIndex: "hint", + key: "hint", + align: "center", + render: (text, record) => { + + return ( + <>{record?.hint ?? "_"} + ); + }, + ellipsis: true, + }, + { + title: `${t("columns.tags")}`, + dataIndex: "tags", + key: "tags", + align: "center", + + render: (text, record) => { + const tags = record?.tags?.map((item:any)=>{ + return item?.name + }) ?? []; + return ( +
+ {tags.length > 0 ? ( + tags.map((tag, index) => ( + + {tag} + {index < tags.length - 1 && ', '} + + )) + ) : ( + _ + )} +
+ ); + }, + ellipsis: true, + }, + { + title: t("columns.question_type"), dataIndex: "isBase", key: "isBase", align: "center", render: (text, record) => - record?.isBase ? t("practical.yes") : t("practical.no"), + record?.isBase ? t("columns.base_question") : t("columns.normal_question"), }, { diff --git a/src/translate/ar.json b/src/translate/ar.json index 0c62043..f81bbce 100644 --- a/src/translate/ar.json +++ b/src/translate/ar.json @@ -187,7 +187,12 @@ "subject":"المادة", "quiz_status":"حالة الاختبار", "creator_name":"اسم المنشئ", - "created_by":"أنشئ بواسطة" + "created_by":"أنشئ بواسطة", + "question_type": "نوع تمرين", + "base_question": " تمرين متعدد ", + "normal_question": " تمرين عادي", + "hint":"شرح ", + "tags":"كلمات مفتاحية" }, "practical": { "to_confirm_deletion_please_re_enter": "لتأكيد الحذف، يرجى إعادة الإدخال",