diff --git a/front/components/assistant/AssistantPreview.tsx b/front/components/assistant/AssistantPreview.tsx index 11c7e0516a58c..8b7a6d29aae3b 100644 --- a/front/components/assistant/AssistantPreview.tsx +++ b/front/components/assistant/AssistantPreview.tsx @@ -4,6 +4,7 @@ import { Chip, DashIcon, MoreIcon, + PlayIcon, PlusIcon, } from "@dust-tt/sparkle"; import { @@ -28,6 +29,7 @@ interface AssistantPreviewProps { onUpdate: () => void; variant: AssistantPreviewVariant; flow: AssistantPreviewFlow; + setTestModalAssistant?: (agentConfiguration: AgentConfigurationType) => void; } function getDescriptionClassName(variant: AssistantPreviewVariant): string { @@ -55,6 +57,7 @@ export function AssistantPreview({ onUpdate, variant, flow, + setTestModalAssistant, }: AssistantPreviewProps) { const [isUpdatingList, setIsUpdatingList] = useState(false); // TODO(flav) Move notification logic to the caller. This maintains the purity of the component by @@ -200,7 +203,24 @@ export function AssistantPreview({ default: assertNever(flow); } - + let testButton = null; + if ( + setTestModalAssistant && + ((flow === "workspace" && agentConfiguration.scope === "published") || + (flow === "personal" && + agentConfiguration.userListStatus === "not-in-list")) + ) { + testButton = ( +