refactors

This commit is contained in:
Abi Raja 2024-01-09 10:01:05 -08:00
parent 955d1a6a58
commit 6d942f3cd7
6 changed files with 13 additions and 15 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 };

View File

@ -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",
}

View File

@ -1,4 +1,4 @@
import { Stack } from "./lib/stacks/types";
import { Stack } from "./lib/stacks";
export enum EditorTheme {
ESPRESSO = "espresso",