diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 634c800..396b3e8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -18,6 +18,9 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/ui/tabs"; import CodeMirror from "./components/CodeMirror"; import SettingsDialog from "./components/SettingsDialog"; import { Settings } from "./types"; +import { IS_RUNNING_ON_CLOUD } from "./config"; +import { PicoBadge } from "./components/PicoBadge"; +import { OnboardingNote } from "./components/OnboardingNote"; function App() { const [appState, setAppState] = useState<"INITIAL" | "CODING" | "CODE_READY">( @@ -100,6 +103,8 @@ function App() { return (
+ {IS_RUNNING_ON_CLOUD && } +
@@ -112,6 +117,8 @@ function App() { )} + {IS_RUNNING_ON_CLOUD && !settings.openAiApiKey && } + {(appState === "CODING" || appState === "CODE_READY") && ( <> {/* Show code preview only when coding */} diff --git a/frontend/src/components/OnboardingNote.tsx b/frontend/src/components/OnboardingNote.tsx new file mode 100644 index 0000000..437bc1e --- /dev/null +++ b/frontend/src/components/OnboardingNote.tsx @@ -0,0 +1,20 @@ +export function OnboardingNote() { + return ( +
+ Please add your OpenAI API key (must have GPT4 vision access) in the + settings dialog (gear icon above). +
+
+ How do you get an OpenAI API key that has the GPT4 Vision model available? + Create an OpenAI account. And then, you need to buy at least $1 worth of + credit on the Billing dashboard. +
+ + This key is never stored. This app is open source. You can{" "} + + check the code to confirm. + + +
+ ); +} diff --git a/frontend/src/components/PicoBadge.tsx b/frontend/src/components/PicoBadge.tsx new file mode 100644 index 0000000..077a99d --- /dev/null +++ b/frontend/src/components/PicoBadge.tsx @@ -0,0 +1,12 @@ +export function PicoBadge() { + return ( + +
+ an open source project by Pico +
+
+ ); +} diff --git a/frontend/src/config.ts b/frontend/src/config.ts new file mode 100644 index 0000000..054f6ed --- /dev/null +++ b/frontend/src/config.ts @@ -0,0 +1,3 @@ +// Default to false if set to anything other than "true" or unset +export const IS_RUNNING_ON_CLOUD = + import.meta.env.VITE_IS_DEPLOYED === "true" || false;