From 6b12bacaf55e69585b490a866a1084af55e5a29b Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Wed, 4 Dec 2024 11:34:00 +0100 Subject: [PATCH] improved state name(frontend) --- .../NewEvaluation/SelectTestsetSection.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/agenta-web/src/components/pages/evaluations/NewEvaluation/SelectTestsetSection.tsx b/agenta-web/src/components/pages/evaluations/NewEvaluation/SelectTestsetSection.tsx index d2e202dae4..3eafa42f07 100644 --- a/agenta-web/src/components/pages/evaluations/NewEvaluation/SelectTestsetSection.tsx +++ b/agenta-web/src/components/pages/evaluations/NewEvaluation/SelectTestsetSection.tsx @@ -16,7 +16,7 @@ const SelectTestsetSection = ({ setSelectedTestsetId, ...props }: SelectTestsetSectionProps) => { - const [selectedRow, setSelectedRow] = useState(null) + const [selectedRows, setSelectedRows] = useState(null) const [searchTerm, setSearchTerm] = useState("") const columns: ColumnsType = [ @@ -67,7 +67,7 @@ const SelectTestsetSection = ({ const handleRemoveTestset = () => { setSelectedTestsetId("") - setSelectedRow(null) + setSelectedRows(null) } return ( @@ -80,12 +80,12 @@ const SelectTestsetSection = ({ label: (
Select Testset
- {selectedRow && ( + {selectedRows && ( } onClose={handleRemoveTestset} > - {selectedRow.name} + {selectedRows.name} )}
@@ -107,10 +107,10 @@ const SelectTestsetSection = ({ rowSelection={{ type: "radio", columnWidth: 48, - selectedRowKeys: [selectedRow?._id as React.Key], - onChange: (_, selectedRow) => { - setSelectedTestsetId(selectedRow[0]._id) - setSelectedRow(selectedRow[0]) + selectedRowKeys: [selectedRows?._id as React.Key], + onChange: (_, selectedRows) => { + setSelectedTestsetId(selectedRows[0]._id) + setSelectedRows(selectedRows[0]) }, }} data-cy="app-testset-list"