/** * Active A/B tests for a prompt (#150) — shows the traffic split per variant. * Per-variant metrics are comparable via the existing per-version analytics. */ import React from 'react'; import { useApi } from '../hooks/useApi'; import { listAbTests } from '../api/prompt-ab'; export function PromptAbTests({ templateId }: { templateId: string }): React.ReactElement | null { const { data } = useApi(() => listAbTests(templateId), [templateId]); const active = (data?.abTests ?? []).filter((t) => t.status === 'active'); if (active.length === 0) return null; return (