Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(ui): hide playground button if not available (#2118)

Marc Klingencd7864cad436
diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsx
index e9bb9b3ca2..7ac25c8c61 100644
--- a/web/src/features/prompts/components/prompt-detail.tsx
+++ b/web/src/features/prompts/components/prompt-detail.tsx
@@ -33,6 +33,7 @@ import {
AccordionTrigger,
} from "@/src/components/ui/accordion";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
+import { isEeAvailable } from "@langfuse/ee";
export const PromptDetail = () => {
const projectId = useProjectIdFromURL();
@@ -112,21 +113,23 @@ export const PromptDetail = () => {
<>
<SetPromptVersionLabels prompt={prompt} />
- <Button
- variant="outline"
- title="Test in prompt playground"
- size="icon"
- onClick={() =>
- capture("prompt_detail:test_in_playground_button_click")
- }
- asChild
- >
- <Link
- href={`/project/${projectId}/playground?promptId=${encodeURIComponent(prompt.id)}`}
+ {isEeAvailable && (
+ <Button
+ variant="outline"
+ title="Test in prompt playground"
+ size="icon"
+ onClick={() =>
+ capture("prompt_detail:test_in_playground_button_click")
+ }
+ asChild
>
- <Terminal className="h-5 w-5" />
- </Link>
- </Button>
+ <Link
+ href={`/project/${projectId}/playground?promptId=${encodeURIComponent(prompt.id)}`}
+ >
+ <Terminal className="h-5 w-5" />
+ </Link>
+ </Button>
+ )}
<Button
variant="outline"