diff --git a/src/components/KaTableComponent.tsx b/src/components/KaTableComponent.tsx index 4af26c98..ffc7a03c 100644 --- a/src/components/KaTableComponent.tsx +++ b/src/components/KaTableComponent.tsx @@ -184,6 +184,20 @@ const KaTableComponent: React.FC = ({ return
{props?.value}
; }, }, + dataRow: { + elementAttributes: ({ rowData }) => { + // Condition to disable or style the row + const isDisabled = rowData.status === Status.ARCHIVED; + + return { + className: isDisabled ? "disabled-row" : "", + style: isDisabled + ? { pointerEvents: "none", opacity: 0.5 } + : {}, + }; + }, + }, + // headCell: { // content: (props) => { // return
{props?.column?.title}
; diff --git a/src/utils/useLocationState.tsx b/src/utils/useLocationState.tsx index 5fa07e71..f062d982 100644 --- a/src/utils/useLocationState.tsx +++ b/src/utils/useLocationState.tsx @@ -122,13 +122,18 @@ export const useLocationState = ( }, }; const response = await getCenterList(object); - setSelectedBlockCohortId( - response?.result?.results?.cohortDetails[0].cohortId - ); - console.log( - "response?.result?.results?.cohortDetails[0].cohortId", - response?.result?.results?.cohortDetails[0].cohortId - ); + const getCohortDetails = response?.result?.results?.cohortDetails; + const blockId = getCohortDetails?.map((item: any) => { + if (item?.type === "BLOCK") { + return item?.cohortId; + } + }); + if (blockId) { + console.log("blockId", blockId[0]); + setSelectedBlockCohortId(blockId[0]); + } else { + console.log("No Block Id found"); + } } else { const getCentersObject = { limit: 200,