Skip to content

Commit

Permalink
fix: Minor UX improvement, spinner if publish URL is still in progres…
Browse files Browse the repository at this point in the history
…s. (#711)

Update AgentPublishStatus.tsx
  • Loading branch information
ivyjeong13 authored Nov 27, 2024
1 parent 22f2e8c commit 52278dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/admin/app/components/agent/Agent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function Agent({ className, onRefresh }: AgentProps) {
<ScrollArea className={cn("h-full", className)}>
<AgentPublishStatus
agent={agentUpdates}
isUpdating={isUpdating}
onChange={partialSetAgent}
/>

Expand Down
6 changes: 6 additions & 0 deletions ui/admin/app/components/agent/AgentPublishStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ import { TypographySmall } from "~/components/Typography";
import { Publish } from "~/components/agent/Publish";
import { Unpublish } from "~/components/agent/Unpublish";
import { CopyText } from "~/components/composed/CopyText";
import { LoadingSpinner } from "~/components/ui/LoadingSpinner";

type AgentPublishStatusProps = {
agent: Agent;
isUpdating: boolean;
onChange: (agent: Partial<Agent>) => void;
};

export function AgentPublishStatus({
agent,
isUpdating,
onChange,
}: AgentPublishStatusProps) {
const getAssistants = useSWR(
Expand Down Expand Up @@ -85,6 +88,9 @@ export function AgentPublishStatus({
);
}

if (isUpdating)
return <LoadingSpinner className="m-l-2 text-muted-foreground" />;

if (!agent.aliasAssigned) return <div />;

const agentUrl = ConsumptionUrl(`/${agent.alias}`);
Expand Down

0 comments on commit 52278dc

Please sign in to comment.