Skip to content

Commit

Permalink
refactor(frontend): improve loading in playground
Browse files Browse the repository at this point in the history
  • Loading branch information
bekossy committed Jun 11, 2024
1 parent 7ed8845 commit 267ddc6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions agenta-web/src/components/Playground/ViewNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ const ViewNavigation: React.FC<Props> = ({
}
}

if (isLoading || isLogsLoading || !variantErrorLogs)
return <ResultComponent status="info" title="Loading variants..." spinner={true} />

if (retrying || (!retriedOnce.current && netWorkError)) {
return (
<>
Expand Down Expand Up @@ -235,11 +238,7 @@ const ViewNavigation: React.FC<Props> = ({
const apiAddress = `${containerURI}/openapi.json`
return (
<div>
{!error ? null : isLogsLoading || !variantErrorLogs ? (
<div className="grid place-items-center mt-10">
<Spin />
</div>
) : (
{error ? (
<div>
<p>
Error connecting to the variant {variant.variantName}.{" "}
Expand Down Expand Up @@ -302,13 +301,13 @@ const ViewNavigation: React.FC<Props> = ({
</Tooltip>
</Button>
</div>
)}
) : null}
</div>
)
}

return (
<Spin spinning={isLoading}>
<>
<Row gutter={[{xs: 8, sm: 16, md: 24, lg: 32}, 20]}>
<Col span={24}>
<ParametersView
Expand Down Expand Up @@ -349,7 +348,7 @@ const ViewNavigation: React.FC<Props> = ({
/>
</Col>
</Row>
</Spin>
</>
)
}

Expand Down

0 comments on commit 267ddc6

Please sign in to comment.