diff --git a/src/DataTable/TemplateTable.tsx b/src/DataTable/TemplateTable.tsx index 351ee15..b253df9 100644 --- a/src/DataTable/TemplateTable.tsx +++ b/src/DataTable/TemplateTable.tsx @@ -12,6 +12,29 @@ import { useEffect, useState } from "react"; import { RowsIcon } from "lucide-react"; import { useSetIsShosen } from "../store/store"; +const category = [ + { + value: "P-CHEM", + text: "Physico-chemical characterisation", + }, + { + value: "ECOTOX", + text: "Ecotoxicity studies", + }, + { + value: "ENV FATE", + text: "Environmental fate", + }, + { + value: "TOX", + text: "Toxicity studies", + }, + { + value: "EXPOSURE", + text: "Exposure", + }, +]; + const columns = [ { accessorKey: "template_name", @@ -36,7 +59,16 @@ const columns = [ { accessorKey: "PROTOCOL_CATEGORY_CODE", header: "Category", - cell: (props) => <>{props.getValue()}, + cell: (props) => { + if (props.getValue() === "ENM_0000068_SECTION") { + return <>Environmental fate; + } + if (props.getValue() === "EC_BACTOX_SECTION") { + return <>Ecotoxicity studies; + } else { + return <>{props.getValue()}; + } + }, }, { accessorKey: "timestamp", diff --git a/src/SurveyComp/SurveyComp.jsx b/src/SurveyComp/SurveyComp.jsx index 015e8c6..63c8866 100644 --- a/src/SurveyComp/SurveyComp.jsx +++ b/src/SurveyComp/SurveyComp.jsx @@ -37,6 +37,8 @@ function SurveyComponent({ setResult }) { survey.data = data; } + console.log(survey.data.PROTOCOL_TOP_CATEGORY); + useEffect(() => { getTemplateInfo(); }, [getTemplateInfo, id]);