Skip to content

Commit 55d9755

Browse files
committed
Disabled use value while test is running
1 parent fcd85c8 commit 55d9755

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/projects/projectId/attributes/attributeId/LLM/LLMPlaygroundModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ export default function LLMPlaygroundModal() {
122122
return attributes.filter(a => DISPLAY_STATES.includes(a.state)).map(a => ({ name: a.name, dataType: a.dataType }));
123123
}, [attributes])
124124

125-
return (<Modal modalName={ModalEnum.LLM_PLAYGROUND} acceptButton={acceptButton} className="ml-10 md:max-w-[calc(100vw-15rem)]">
125+
const finalAcceptButton = useMemo(() => {
126+
if (playgroundTestRunning) return { ...acceptButton, disabled: true };
127+
return acceptButton;
128+
}, [acceptButton, playgroundTestRunning])
129+
130+
return (<Modal modalName={ModalEnum.LLM_PLAYGROUND} acceptButton={finalAcceptButton} className="ml-10 md:max-w-[calc(100vw-15rem)]">
126131
<div className="pl-2 pr-5 max-h-[calc(100vh-15rem)] overflow-y-auto">
127132
<div className="flex flex-row items-center justify-center">
128133
<span className="text-lg flex flex-row gap-x-2 text-gray-900 font-medium items-center">

0 commit comments

Comments
 (0)