refactors
This commit is contained in:
parent
955d1a6a58
commit
6d942f3cd7
@ -34,7 +34,7 @@ import HistoryDisplay from "./components/history/HistoryDisplay";
|
|||||||
import { extractHistoryTree } from "./components/history/utils";
|
import { extractHistoryTree } from "./components/history/utils";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import ImportCodeSection from "./components/ImportCodeSection";
|
import ImportCodeSection from "./components/ImportCodeSection";
|
||||||
import { Stack } from "./lib/stacks/types";
|
import { Stack } from "./lib/stacks";
|
||||||
|
|
||||||
const IS_OPENAI_DOWN = false;
|
const IS_OPENAI_DOWN = false;
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
import { Textarea } from "./ui/textarea";
|
import { Textarea } from "./ui/textarea";
|
||||||
import OutputSettingsSection from "./OutputSettingsSection";
|
import OutputSettingsSection from "./OutputSettingsSection";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { Stack } from "../lib/stacks/types";
|
import { Stack } from "../lib/stacks";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
importFromCode: (code: string, stack: Stack) => void;
|
importFromCode: (code: string, stack: Stack) => void;
|
||||||
|
|||||||
@ -7,8 +7,7 @@ import {
|
|||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
} from "./ui/select";
|
} from "./ui/select";
|
||||||
import { Badge } from "./ui/badge";
|
import { Badge } from "./ui/badge";
|
||||||
import { Stack } from "../lib/stacks/types";
|
import { Stack, STACK_DESCRIPTIONS } from "../lib/stacks";
|
||||||
import { STACK_DESCRIPTIONS } from "../lib/stacks/descriptions";
|
|
||||||
|
|
||||||
function generateDisplayComponent(stack: Stack) {
|
function generateDisplayComponent(stack: Stack) {
|
||||||
const stackComponents = STACK_DESCRIPTIONS[stack].components;
|
const stackComponents = STACK_DESCRIPTIONS[stack].components;
|
||||||
|
|||||||
@ -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: {
|
export const STACK_DESCRIPTIONS: {
|
||||||
[key in Stack]: { components: string[]; inBeta: boolean };
|
[key in Stack]: { components: string[]; inBeta: boolean };
|
||||||
@ -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",
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Stack } from "./lib/stacks/types";
|
import { Stack } from "./lib/stacks";
|
||||||
|
|
||||||
export enum EditorTheme {
|
export enum EditorTheme {
|
||||||
ESPRESSO = "espresso",
|
ESPRESSO = "espresso",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user