Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

refactors

Abi Raja6d942f3cd73e
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index cab77b75..3f7a025a 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -34,7 +34,7 @@ import HistoryDisplay from "./components/history/HistoryDisplay";
import { extractHistoryTree } from "./components/history/utils";
import toast from "react-hot-toast";
import ImportCodeSection from "./components/ImportCodeSection";
-import { Stack } from "./lib/stacks/types";
+import { Stack } from "./lib/stacks";
const IS_OPENAI_DOWN = false;
diff --git a/frontend/src/components/ImportCodeSection.tsx b/frontend/src/components/ImportCodeSection.tsx
index 94d3cf1f..b320a978 100644
--- a/frontend/src/components/ImportCodeSection.tsx
+++ b/frontend/src/components/ImportCodeSection.tsx
@@ -12,7 +12,7 @@ import {
import { Textarea } from "./ui/textarea";
import OutputSettingsSection from "./OutputSettingsSection";
import toast from "react-hot-toast";
-import { Stack } from "../lib/stacks/types";
+import { Stack } from "../lib/stacks";
interface Props {
importFromCode: (code: string, stack: Stack) => void;
diff --git a/frontend/src/components/OutputSettingsSection.tsx b/frontend/src/components/OutputSettingsSection.tsx
index c0acac93..64f62cb1 100644
--- a/frontend/src/components/OutputSettingsSection.tsx
+++ b/frontend/src/components/OutputSettingsSection.tsx
@@ -7,8 +7,7 @@ import {
SelectTrigger,
} from "./ui/select";
import { Badge } from "./ui/badge";
-import { Stack } from "../lib/stacks/types";
-import { STACK_DESCRIPTIONS } from "../lib/stacks/descriptions";
+import { Stack, STACK_DESCRIPTIONS } from "../lib/stacks";
function generateDisplayComponent(stack: Stack) {
const stackComponents = STACK_DESCRIPTIONS[stack].components;
diff --git a/frontend/src/lib/stacks/descriptions.ts b/frontend/src/lib/stacks.ts
similarity index 65%
rename from frontend/src/lib/stacks/descriptions.ts
rename to frontend/src/lib/stacks.ts
index 0f6cb313..b8b372e2 100644
--- a/frontend/src/lib/stacks/descriptions.ts
+++ b/frontend/src/lib/stacks.ts
@@ -1,4 +1,12 @@
-import { Stack } from "./types";
+// Keep in sync with backend (prompts/types.py)
+export enum Stack {
+ HTML_TAILWIND = "html_tailwind",
+ REACT_TAILWIND = "react_tailwind",
+ BOOTSTRAP = "bootstrap",
+ VUE_TAILWIND = "vue_tailwind",
+ IONIC_TAILWIND = "ionic_tailwind",
+ SVG = "svg",
+}
export const STACK_DESCRIPTIONS: {
[key in Stack]: { components: string[]; inBeta: boolean };
diff --git a/frontend/src/lib/stacks/types.ts b/frontend/src/lib/stacks/types.ts
deleted file mode 100644
index 7edb0b53..00000000
--- a/frontend/src/lib/stacks/types.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-// Keep in sync with backend (prompts/types.py)
-export enum Stack {
- HTML_TAILWIND = "html_tailwind",
- REACT_TAILWIND = "react_tailwind",
- BOOTSTRAP = "bootstrap",
- VUE_TAILWIND = "vue_tailwind",
- IONIC_TAILWIND = "ionic_tailwind",
- SVG = "svg",
-}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 11f023e7..4e2c2fa0 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -1,4 +1,4 @@
-import { Stack } from "./lib/stacks/types";
+import { Stack } from "./lib/stacks";
export enum EditorTheme {
ESPRESSO = "espresso",