feat: Update SwitchOutputView component to handle array result type

This commit is contained in:
anovazzi1 2024-06-04 16:57:56 -03:00
commit 88f1e6602b
2 changed files with 14 additions and 8 deletions

View file

@ -48,13 +48,19 @@ export default function SwitchOutputView(nodeId): JSX.Element {
columnMode="union"
/>
</Case>
<Case condition={resultType === "array"}>
<RecordsOutputComponent
rows={resultMessage}
pagination={true}
columnMode="union"
/>
</Case>
{Array.isArray(resultMessage) && (
<Case condition={resultType === "array"}>
<RecordsOutputComponent
rows={
(resultMessage as Array<any>).every((item) => item.data)
? (resultMessage as Array<any>).map((item) => item.data)
: resultMessage
}
pagination={true}
columnMode="union"
/>
</Case>
)}
</>
);
}

View file

@ -161,7 +161,7 @@ export type VertexBuildTypeAPI = {
// it has results, artifacts, timedelta, duration
export type VertexDataTypeAPI = {
results: { [key: string]: string };
logs: { message: string; type: string }[];
logs: any[];
messages: ChatOutputType[] | chatInputType[];
inactive?: boolean;
timedelta?: number;