@@ -12,6 +12,8 @@ import { GraphContext } from './components/provider';
1212import Image from 'next/image' ;
1313import { DropdownMenu , DropdownMenuContent , DropdownMenuLabel , DropdownMenuTrigger } from '@/components/ui/dropdown-menu' ;
1414import { prepareArg } from './utils' ;
15+ import { Dialog , DialogContent , DialogDescription , DialogHeader , DialogTitle , DialogTrigger } from '@/components/ui/dialog' ;
16+ import { Progress } from '@/components/ui/progress' ;
1517
1618export type PathNode = {
1719 id ?: number
@@ -92,6 +94,7 @@ export default function Home() {
9294 title : "Uh oh! Something went wrong." ,
9395 description : await result . text ( ) ,
9496 } )
97+ setIsSubmit ( false )
9598 return
9699 }
97100
@@ -209,50 +212,53 @@ export default function Home() {
209212 }
210213 </ DropdownMenuContent >
211214 </ DropdownMenu >
212- { /* <Dialog open={createOpen} onOpenChange={setCreateOpen}>
213- <DialogTrigger asChild>
214- <button
215- className="h-full bg-black p-4 text-white rounded-lg"
216- title="Create new project"
217- >
218- <p>Create new project</p>
219- </button>
220- </DialogTrigger>
221- <DialogContent className='max-w-[26%] gap-8'>
222- <DialogHeader>
223- <DialogTitle>{!isSubmit ? "CREATE A NEW PROJECT" : "THANK YOU FOR A NEW REQUEST"}</DialogTitle>
224- </DialogHeader>
225- <DialogDescription className='text-warp'>
215+ {
216+ process . env . NEXT_PUBLIC_LOCAL_MODE &&
217+ < Dialog open = { createOpen } onOpenChange = { setCreateOpen } >
218+ < DialogTrigger asChild >
219+ < button
220+ className = "h-full bg-black p-4 text-white rounded-lg"
221+ title = "Create new project"
222+ >
223+ < p > Create new project</ p >
224+ </ button >
225+ </ DialogTrigger >
226+ < DialogContent className = 'sm:max-w-[500px]' >
227+ < DialogHeader >
228+ < DialogTitle > { ! isSubmit ? "CREATE A NEW PROJECT" : "THANK YOU FOR A NEW REQUEST" } </ DialogTitle >
229+ </ DialogHeader >
230+ < DialogDescription className = 'text-black' >
231+ {
232+ ! isSubmit
233+ ? "Please provide the URL of the project to connect and start querying data"
234+ : "Processing your graph, this could take a while. We appreciate your patience"
235+ }
236+ </ DialogDescription >
226237 {
227- !isSubmit
228- ? "Please provide the URL of the model to connect and start querying data"
229- : "Processing your graph, this could take a while. We appreciate your patience"
238+ ! isSubmit ?
239+ < form className = 'flex flex-col gap-4' >
240+ < input
241+ className = 'border p-3 rounded-lg'
242+ type = "text"
243+ value = { createURL }
244+ onChange = { ( e ) => setCreateURL ( e . target . value ) }
245+ placeholder = "Type Project URL (File:// or https://)"
246+ />
247+ < div className = 'flex flex-row-reverse' >
248+ < button
249+ className = 'bg-black p-3 text-white rounded-lg'
250+ type = 'submit'
251+ title = 'Create Project'
252+ >
253+ < p > Create</ p >
254+ </ button >
255+ </ div >
256+ </ form >
257+ : < Progress value = { 0 } />
230258 }
231- </DialogDescription>
232- {
233- !isSubmit ?
234- <form className='flex flex-col gap-4' onSubmit={onCreateRepo}>
235- <input
236- className='border p-3 rounded-lg'
237- type="text"
238- value={createURL}
239- onChange={(e) => setCreateURL(e.target.value)}
240- placeholder="Type URL"
241- />
242- <div className='flex flex-row-reverse'>
243- <button
244- className='bg-black p-3 text-white rounded-lg'
245- type='submit'
246- title='Create Project'
247- >
248- <p>Create</p>
249- </button>
250- </div>
251- </form>
252- : <Progress value={0} />
253- }
254- </DialogContent>
255- </Dialog> */ }
259+ </ DialogContent >
260+ </ Dialog >
261+ }
256262 </ ul >
257263 </ div >
258264 < div className = 'h-2.5 bg-gradient-to-r from-[#EC806C] via-[#B66EBD] to-[#7568F2]' />
0 commit comments