@@ -26,7 +26,7 @@ import { SpinnerLoader } from "../../widgets/spinner-loader/SpinnerLoader";
2626import { TokenUsage } from "../token-usage/TokenUsage" ;
2727import { useWindowDimensions } from "../../../hooks/useWindowDimensions" ;
2828import { useCustomToolStore } from "../../../store/custom-tool-store" ;
29- import { TABLE_ENFORCE_TYPE } from "./constants" ;
29+ import { TABLE_ENFORCE_TYPE , RECORD_ENFORCE_TYPE } from "./constants" ;
3030import { CopyPromptOutputBtn } from "./CopyPromptOutputBtn" ;
3131import { useAlertStore } from "../../../store/alert-store" ;
3232import { PromptOutputExpandBtn } from "./PromptOutputExpandBtn" ;
@@ -78,6 +78,8 @@ function PromptOutput({
7878 } = useCustomToolStore ( ) ;
7979 const { setAlertDetails } = useAlertStore ( ) ;
8080 const { generatePromptOutputKey } = usePromptOutput ( ) ;
81+ const isTableExtraction =
82+ enforceType === TABLE_ENFORCE_TYPE || enforceType === RECORD_ENFORCE_TYPE ;
8183
8284 const tooltipContent = ( adapterConf ) => (
8385 < div >
@@ -100,7 +102,7 @@ function PromptOutput({
100102 const getColSpan = ( ) => ( componentWidth < 1200 ? 24 : 6 ) ;
101103
102104 const copyOutputToClipboard = ( text ) => {
103- if ( ! text || text === "undefined" || enforceType === TABLE_ENFORCE_TYPE ) {
105+ if ( ! text || text === "undefined" || isTableExtraction ) {
104106 return ;
105107 }
106108
@@ -152,7 +154,7 @@ function PromptOutput({
152154 ) }
153155 < div className = "prompt-profile-run" >
154156 < CopyPromptOutputBtn
155- isDisabled = { enforceType === TABLE_ENFORCE_TYPE }
157+ isDisabled = { isTableExtraction }
156158 copyToClipboard = { ( ) =>
157159 copyOutputToClipboard ( displayPromptResult ( promptOutput , true ) )
158160 }
@@ -323,7 +325,7 @@ function PromptOutput({
323325 < >
324326 < Divider className = "prompt-card-divider" />
325327 < div className = { "prompt-card-result prompt-card-div" } >
326- { enforceType === TABLE_ENFORCE_TYPE ? (
328+ { isTableExtraction ? (
327329 < div />
328330 ) : (
329331 < >
@@ -374,7 +376,7 @@ function PromptOutput({
374376 </ Button >
375377 </ Tooltip >
376378 < CopyPromptOutputBtn
377- isDisabled = { enforceType === TABLE_ENFORCE_TYPE }
379+ isDisabled = { isTableExtraction }
378380 copyToClipboard = { ( ) =>
379381 copyOutputToClipboard (
380382 displayPromptResult ( promptOutputData ?. output , true )
@@ -390,7 +392,7 @@ function PromptOutput({
390392 />
391393 </ div >
392394 </ div >
393- { enforceType === TABLE_ENFORCE_TYPE && TableOutput && (
395+ { isTableExtraction && TableOutput && (
394396 < TableOutput output = { promptOutputData ?. output } />
395397 ) }
396398 </ >
0 commit comments