File size: 493 Bytes
06a2cae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from agent.file_ops import write

def coder(plan, ws):
    write(f"{ws}/index.html",
"""<!doctype html>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
""")

    write(f"{ws}/src/main.jsx",
"""import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")).render(<App />);
""")

    write(f"{ws}/src/App.jsx",
f"""export default function App() {{
  return <h1>{plan['goal']}</h1>
}}
""")