Merge branch 'main' into hosted

This commit is contained in:
Abi Raja 2024-01-09 10:02:29 -08:00
commit b35738524b
6 changed files with 14 additions and 16 deletions

View File

@ -36,7 +36,7 @@ import toast from "react-hot-toast";
import ImportCodeSection from "./components/ImportCodeSection";
import { useAuth } from "@clerk/clerk-react";
import { useStore } from "./store/store";
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

@ -8,8 +8,7 @@ import {
} from "./ui/select";
import { addEvent } from "../lib/analytics";
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;
@ -57,7 +56,7 @@ function OutputSettingsSection({
<SelectContent>
<SelectGroup>
{Object.values(Stack).map((stack) => (
<SelectItem value={stack}>
<SelectItem key={stack} value={stack}>
<div className="flex items-center">
{generateDisplayComponent(stack)}
{STACK_DESCRIPTIONS[stack].inBeta && (

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