Skip to content

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

Python

also use currentVersion

Abi Raja83f6f00b108e
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index fa0b485e..c85c09f4 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -56,6 +56,8 @@ function App() {
setReferenceImages,
generatedCode,
setGeneratedCode,
+ currentVersion,
+ setCurrentVersion,
} = useProjectStore();
const [executionConsole, setExecutionConsole] = useState<string[]>([]);
@@ -88,8 +90,6 @@ function App() {
// App history
const [appHistory, setAppHistory] = useState<History>([]);
- // Tracks the currently shown version from app history
- const [currentVersion, setCurrentVersion] = useState<number | null>(null);
const [shouldIncludeResultImage, setShouldIncludeResultImage] =
useState<boolean>(false);
diff --git a/frontend/src/store/project-store.ts b/frontend/src/store/project-store.ts
index 4b2c5472..ec2510f1 100644
--- a/frontend/src/store/project-store.ts
+++ b/frontend/src/store/project-store.ts
@@ -16,8 +16,12 @@ interface ProjectStore {
setGeneratedCode: (
updater: string | ((currentCode: string) => string)
) => void;
+
+ // Tracks the currently shown version from app history
+ // TODO: might want to move to appStore
currentVersion: number | null;
setCurrentVersion: (version: number | null) => void;
+
appHistory: History[];
setAppHistory: (history: History[]) => void;
}