Spaces:
Running
Running
| import{r as s,j as e}from"./react-B-lWpQRQ.js";import{I as h,L as x,M as j,a_ as b}from"./index-DyMS-nC-.js";import"./@google-xfXoiafW.js";import"./@braintree-DY5JYOZd.js";import"./react-dom-CU2yWD-Y.js";import"./scheduler-DYLXRpC5.js";import"./idb-Dob3nYDb.js";import"./axe-core-CA05Kxsw.js";import"./marked-CesSW9Du.js";import"./@mermaid-js-Ce0__7Tp.js";import"./langium-B_PGe6V2.js";import"./vscode-jsonrpc-2tvYB2ki.js";import"./chevrotain-D5DQZOif.js";import"./@chevrotain-DMYZVohV.js";import"./lodash-es-CKTcnrxn.js";import"./chevrotain-allstar-eFSt8-qu.js";import"./vscode-languageserver-types-NoPvPymt.js";import"./vscode-languageserver-textdocument-CKBVUiR3.js";import"./vscode-uri-CoxP0whD.js";const v='<button className="bg-blue-500 text-white p-2 rounded">Sign Up</button>',N='<button className="bg-green-500 text-white p-2 rounded">Get Started</button>',H=()=>{const[r,p]=s.useState(v),[n,u]=s.useState(N),[l,f]=s.useState("LaunchDarkly"),[o,i]=s.useState(""),[a,c]=s.useState(!1),[m,d]=s.useState(""),g=async()=>{c(!0),d(""),i("");try{const t=await b(r,n,l);i(t)}catch(t){d(t instanceof Error?t.message:"Failed to generate wrapper component")}finally{c(!1)}};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center",children:[e.jsx(h,{}),e.jsx("span",{className:"ml-3",children:"A/B Test Assistant"})]}),e.jsx("p",{className:"text-text-secondary mt-1",children:"Generate code snippets for A/B tests using a feature flagging service."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("label",{className:"text-sm font-medium mb-2",children:"Variant A Code"}),e.jsx("textarea",{value:r,onChange:t=>p(t.target.value),className:"flex-grow p-2 bg-surface border rounded font-mono text-xs"})]}),e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("label",{className:"text-sm font-medium mb-2",children:"Variant B Code"}),e.jsx("textarea",{value:n,onChange:t=>u(t.target.value),className:"flex-grow p-2 bg-surface border rounded font-mono text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium",children:"Feature Flag Service"}),e.jsxs("select",{value:l,onChange:t=>f(t.target.value),className:"w-full mt-1 p-2 bg-surface border rounded",children:[e.jsx("option",{children:"LaunchDarkly"}),e.jsx("option",{children:"PostHog"}),e.jsx("option",{children:"Generic"})]})]}),e.jsx("button",{onClick:g,disabled:a,className:"btn-primary w-full py-3",children:a?e.jsx(x,{}):"Generate Wrapper Component"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("label",{className:"text-sm font-medium mb-2",children:"Generated Wrapper Component"}),e.jsx("div",{className:"flex-grow p-1 bg-background border rounded overflow-auto",children:a?e.jsx("div",{className:"flex justify-center items-center h-full",children:e.jsx(x,{})}):e.jsxs(e.Fragment,{children:[m&&e.jsx("p",{className:"text-red-500 p-4",children:m}),o&&e.jsx(j,{content:o})]})})]})]})]})};export{H as ABTestAssistant}; | |
| //# sourceMappingURL=ABTestAssistant-CYTkocO5.js.map | |