(vars: { url: string; tweetCount: number })
| 3 | import { Box, Button, Input, Label, Spinner } from "theme-ui"; |
| 4 | |
| 5 | async function createTwitterThread(vars: { url: string; tweetCount: number }) { |
| 6 | const res = await fetch("/api/createTwitterThread", { |
| 7 | method: "POST", |
| 8 | headers: { |
| 9 | "Content-Type": "application/json", |
| 10 | }, |
| 11 | body: JSON.stringify(vars), |
| 12 | }); |
| 13 | |
| 14 | if (!res.ok) { |
| 15 | throw new Error("Failed to createTwitterThread"); |
| 16 | } |
| 17 | |
| 18 | return res.text(); |
| 19 | } |
| 20 | |
| 21 | const Thread = (props: { text: string }) => { |
| 22 | const text = props.text.replaceAll(/(\n)+/g, "\n\n"); |
nothing calls this directly
no outgoing calls
no test coverage detected