Spaces:
Running
Running
fix mobile
Browse filesFiles changed (5)
1234561 unmodified line89101112137 unmodified lines21222324252627282930313233343536373839403 unmodified lines444546474849import { useState } from "react";import { useLocalStorage } from "react-use";import { ArrowUp } from "lucide-react";import { useRouter } from "next/navigation";import { Button } from "@/components/ui/button";1 unmodified lineimport { PromptBuilder } from "./prompt-builder";import { EnhancedSettings } from "@/types";import { Settings } from "./settings";export const FakeAskAi = () => {const router = useRouter();7 unmodified linestheme: undefined,});const [, setPromptStorage] = useLocalStorage("prompt", "");const callAi = async () => {setPromptStorage(prompt);router.push("/projects/new");};// todo redirect to login + set prompt in storage, then redirect to projects/new + set the prompt in the statereturn (<div className="p-3 w-full max-w-xl mx-auto"><div className="relative bg-neutral-800 border border-neutral-700 rounded-2xl ring-[4px] focus-within:ring-neutral-500/30 focus-within:border-neutral-600 ring-transparent z-20 w-full group"><div className="w-full relative flex items-center justify-between"><textareaclassName="w-full bg-transparent text-sm outline-none text-white placeholder:text-neutral-400 p-4 resize-none"placeholder="Ask DeepSite anything..."value={prompt}onChange={(e) => setPrompt(e.target.value)}3 unmodified lines}}}/></div><div className="flex items-center justify-between gap-2 px-4 pb-3 mt-2"><div className="flex-1 flex items-center justify-start gap-1.5 flex-wrap">1234561 unmodified line891011121314151617181920212223242526272829303132337 unmodified lines4142434445464748495051525354555657585960616263646566673 unmodified lines717273747576777879808182838485868788import { useState } from "react";import { useLocalStorage } from "react-use";import { ArrowUp, Dice1, Dice6 } from "lucide-react";import { useRouter } from "next/navigation";import { Button } from "@/components/ui/button";1 unmodified lineimport { PromptBuilder } from "./prompt-builder";import { EnhancedSettings } from "@/types";import { Settings } from "./settings";import classNames from "classnames";const prompts = ["Create a landing page for a SaaS product, with a hero section, a features section, a pricing section, and a call to action section.","Create a portfolio website for a designer, with a hero section, a projects section, a about section, and a contact section.","Create a blog website for a writer, with a hero section, a blog section, a about section, and a contact section.","Create a Tic Tac Toe game, with a game board, a history section, and a score section.","Create a Weather App, with a search bar, a weather section, and a forecast section.","Create a Calculator, with a calculator section, and a history section.","Create a Todo List, with a todo list section, and a history section.","Create a Calendar, with a calendar section, and a history section.","Create a Music Player, with a music player section, and a history section.","Create a Quiz App, with a quiz section, and a history section.","Create a Pomodoro Timer, with a timer section, and a history section.","Create a Notes App, with a notes section, and a history section.","Create a Task Manager, with a task list section, and a history section.","Create a Password Generator, with a password generator section, and a history section.","Create a Currency Converter, with a currency converter section, and a history section.","Create a Dictionary, with a dictionary section, and a history section.",];export const FakeAskAi = () => {const router = useRouter();7 unmodified linestheme: undefined,});const [, setPromptStorage] = useLocalStorage("prompt", "");const [randomPromptLoading, setRandomPromptLoading] = useState(false);const callAi = async () => {setPromptStorage(prompt);router.push("/projects/new");};const randomPrompt = () => {setRandomPromptLoading(true);setTimeout(() => {setPrompt(prompts[Math.floor(Math.random() * prompts.length)]);setRandomPromptLoading(false);}, 400);};return (<div className="p-3 w-full max-w-xl mx-auto"><div className="relative bg-neutral-800 border border-neutral-700 rounded-2xl ring-[4px] focus-within:ring-neutral-500/30 focus-within:border-neutral-600 ring-transparent z-20 w-full group"><div className="w-full relative flex items-start justify-between pr-4 pt-4"><textareaclassName="w-full bg-transparent text-sm outline-none text-white placeholder:text-neutral-400 px-4 pb-4 resize-none"placeholder="Ask DeepSite anything..."value={prompt}onChange={(e) => setPrompt(e.target.value)}3 unmodified lines}}}/><Buttonsize="iconXs"variant="outline"className="!rounded-md"onClick={() => randomPrompt()}><Dice6className={classNames("size-4", {"animate-spin animation-duration-500": randomPromptLoading,})}/></Button></div><div className="flex items-center justify-between gap-2 px-4 pb-3 mt-2"><div className="flex-1 flex items-center justify-start gap-1.5 flex-wrap">
100 unmodified lines101102103104105106107100 unmodified lines<UserMenu className="!pl-1 !pr-3 !py-1 !h-auto" />) : (<Button size="sm" onClick={openLoginWindow}>Start Vibe Coding<ArrowRight className="size-4" /></Button>)}100 unmodified lines101102103104105106107108100 unmodified lines<UserMenu className="!pl-1 !pr-3 !py-1 !h-auto" />) : (<Button size="sm" onClick={openLoginWindow}><span className="max-lg:hidden">Start Vibe Coding</span><span className="lg:hidden">Log In</span><ArrowRight className="size-4" /></Button>)}
50 unmodified lines515253545556575850 unmodified linesconst editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);useMount(() => {if (isNew) {setPages(pagesStorage || []);removePagesStorage();}});50 unmodified lines515253545556575850 unmodified linesconst editorRef = useRef<editor.IStandaloneCodeEditor | null>(null);useMount(() => {if (isNew && pagesStorage) {setPages(pagesStorage);removePagesStorage();}});
117 unmodified lines118119120121122123124117 unmodified lines<divclassName={classNames("flex flex-col animate-in fade-in duration-300",isMaximized ? "w-[60dvw] h-[80dvh]" : "w-80 h-96")}><div className="flex items-center justify-between p-3 border-b border-neutral-200">117 unmodified lines118119120121122123124117 unmodified lines<divclassName={classNames("flex flex-col animate-in fade-in duration-300",isMaximized ? "w-[90dvw] lg:w-[60dvw] h-[80dvh]" : "w-80 h-96")}><div className="flex items-center justify-between p-3 border-b border-neutral-200">
211 unmodified lines212213214215216217218211 unmodified linesclassName={classNames("bg-neutral-900/30 w-full h-[calc(100dvh-57px)] flex flex-col items-center justify-center relative z-1 lg:border-l border-neutral-800",{"max-lg:h-0": currentTab === "chat","max-lg:h-full": currentTab === "preview",})}211 unmodified lines212213214215216217218211 unmodified linesclassName={classNames("bg-neutral-900/30 w-full h-[calc(100dvh-57px)] flex flex-col items-center justify-center relative z-1 lg:border-l border-neutral-800",{"max-lg:h-0 overflow-hidden": currentTab === "chat","max-lg:h-full": currentTab === "preview",})}
components/editor/ask-ai/fake-ask.tsx+43-4
components/editor/header/index.tsx+2-1
components/editor/index.tsx+2-2
components/editor/live-preview/index.tsx+1-1
components/editor/preview/index.tsx+1-1