The best way to control Claude Code, Codex and more from any computer or phone

main
tsx 128 lines 4.13 KB
Raw
1 import { useState } from "react";
2 import cloudflareLogo from "./assets/cloudflare.svg";
3 import heroImg from "./assets/hero.png";
4 import reactLogo from "./assets/react.svg";
5 import viteLogo from "./assets/vite.svg";
6 import "./App.css";
7
8 function App() {
9 const [count, setCount] = useState(0);
10 const [name, setName] = useState("unknown");
11
12 return (
13 <>
14 <section id="center">
15 <div className="hero">
16 <img src={heroImg} className="base" width="170" height="179" alt="" />
17 <img src={reactLogo} className="framework" alt="React logo" />
18 <img src={viteLogo} className="vite" alt="Vite logo" />
19 </div>
20 <div>
21 <h1>Get started with Cloudflare</h1>
22 <p>
23 Edit <code>src/App.tsx</code> or <code>worker/index.ts</code> and save to test{" "}
24 <code>HMR</code>
25 </p>
26 </div>
27 <ul style={{ display: "flex", gap: "1rem", listStyle: "none", padding: 0 }}>
28 <li>
29 <button className="counter" onClick={() => setCount((count) => count + 1)}>
30 Count is {count}
31 </button>
32 </li>
33 <li>
34 <button
35 className="counter"
36 onClick={() => {
37 fetch("/api/")
38 .then((res) => res.json())
39 .then((data) => setName(data.name));
40 }}
41 aria-label="get name"
42 >
43 Name from API is: {name}
44 </button>
45 </li>
46 </ul>
47 </section>
48
49 <div className="ticks"></div>
50
51 <section id="next-steps">
52 <div id="docs">
53 <svg className="icon" role="presentation" aria-hidden="true">
54 <use href="/icons.svg#documentation-icon"></use>
55 </svg>
56 <h2>Documentation</h2>
57 <p>Your questions, answered</p>
58 <ul>
59 <li>
60 <a href="https://vite.dev/" target="_blank">
61 <img className="logo" src={viteLogo} alt="" />
62 Explore Vite
63 </a>
64 </li>
65 <li>
66 <a href="https://react.dev/" target="_blank">
67 <img className="button-icon" src={reactLogo} alt="" />
68 Learn more
69 </a>
70 </li>
71 <li>
72 <a href="https://workers.cloudflare.com/" target="_blank">
73 <img className="button-icon" src={cloudflareLogo} alt="" />
74 Workers Docs
75 </a>
76 </li>
77 </ul>
78 </div>
79 <div id="social">
80 <svg className="icon" role="presentation" aria-hidden="true">
81 <use href="/icons.svg#social-icon"></use>
82 </svg>
83 <h2>Connect with us</h2>
84 <p>Join the Vite community</p>
85 <ul>
86 <li>
87 <a href="https://github.com/vitejs/vite" target="_blank">
88 <svg className="button-icon" role="presentation" aria-hidden="true">
89 <use href="/icons.svg#github-icon"></use>
90 </svg>
91 GitHub
92 </a>
93 </li>
94 <li>
95 <a href="https://chat.vite.dev/" target="_blank">
96 <svg className="button-icon" role="presentation" aria-hidden="true">
97 <use href="/icons.svg#discord-icon"></use>
98 </svg>
99 Discord
100 </a>
101 </li>
102 <li>
103 <a href="https://x.com/vite_js" target="_blank">
104 <svg className="button-icon" role="presentation" aria-hidden="true">
105 <use href="/icons.svg#x-icon"></use>
106 </svg>
107 X.com
108 </a>
109 </li>
110 <li>
111 <a href="https://bsky.app/profile/vite.dev" target="_blank">
112 <svg className="button-icon" role="presentation" aria-hidden="true">
113 <use href="/icons.svg#bluesky-icon"></use>
114 </svg>
115 Bluesky
116 </a>
117 </li>
118 </ul>
119 </div>
120 </section>
121
122 <div className="ticks"></div>
123 <section id="spacer"></section>
124 </>
125 );
126 }
127
128 export default App;