@@ -12,13 +12,16 @@ import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
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' ;
1517import { Carousel , CarouselApi , CarouselContent , CarouselItem , CarouselNext , CarouselPrevious } from '@/components/ui/carousel' ;
1618import { Drawer , DrawerContent , DrawerDescription , DrawerTitle , DrawerTrigger } from '@/components/ui/drawer' ;
1719import Input from './components/Input' ;
1820import { ForceGraphMethods , NodeObject } from 'react-force-graph-2d' ;
1921import { Labels } from './components/labels' ;
2022import { Toolbar } from './components/toolbar' ;
2123import { cn , handleZoomToFit , Message , Path , PathData , PathNode } from '@/lib/utils' ;
24+ import { GraphContext } from './components/provider' ;
2225
2326type Tip = {
2427 title : string
@@ -118,6 +121,7 @@ export default function Home() {
118121 title : "Uh oh! Something went wrong." ,
119122 description : await result . text ( ) ,
120123 } )
124+ setIsSubmit ( false )
121125 return
122126 }
123127
@@ -329,60 +333,59 @@ export default function Home() {
329333 }
330334 </ DropdownMenuContent >
331335 </ DropdownMenu >
332- { /* <Dialog open={createOpen} onOpenChange={setCreateOpen}>
333- <DialogTrigger asChild>
334- <button
335- className="h-full bg-black p-4 text-white rounded-lg"
336- title="Create new project"
337- >
338- <p>Create new project</p>
339- </button>
340- </DialogTrigger>
341- <DialogContent className='max-w-[26%] gap-8'>
342- <DialogHeader>
343- <DialogTitle>{!isSubmit ? "CREATE A NEW PROJECT" : "THANK YOU FOR A NEW REQUEST"}</DialogTitle>
344- </DialogHeader>
345- <DialogDescription className='text-warp'>
346336 {
347- !isSubmit
348- ? "Please provide the URL of the model to connect and start querying data"
349- : "Processing your graph, this could take a while. We appreciate your patience"
350- }
351- </DialogDescription>
352- {
353- !isSubmit ?
354- <form className='flex flex-col gap-4' onSubmit={onCreateRepo}>
355- <input
356- className='border p-3 rounded-lg'
357- type="text"
358- value={createURL}
359- onChange={(e) => setCreateURL(e.target.value)}
360- placeholder="Type URL"
361- />
362- <div className='flex flex-row-reverse'>
363- <button
364- className='bg-black p-3 text-white rounded-lg'
365- type='submit'
366- title='Create Project'
367- >
368- <p>Create</p>
369- </button>
370- </div>
371- </form>
372- : <Progress value={0} />
373- }
337+ process . env . NEXT_PUBLIC_LOCAL_MODE &&
338+ < Dialog open = { createOpen } onOpenChange = { setCreateOpen } >
339+ < DialogTrigger asChild >
340+ < button
341+ className = "h-full bg-black p-4 text-white rounded-lg"
342+ title = "Create new project"
343+ >
344+ < p > Create new project</ p >
345+ </ button >
346+ </ DialogTrigger >
347+ < DialogContent className = 'sm:max-w-[500px]' >
348+ < DialogHeader >
349+ < DialogTitle > { ! isSubmit ? "CREATE A NEW PROJECT" : "THANK YOU FOR A NEW REQUEST" } </ DialogTitle >
350+ </ DialogHeader >
351+ < DialogDescription className = 'text-black' >
352+ {
353+ ! isSubmit
354+ ? "Please provide the URL of the project to connect and start querying data"
355+ : "Processing your graph, this could take a while. We appreciate your patience"
356+ }
357+ </ DialogDescription >
358+ {
359+ ! isSubmit ?
360+ < form onSubmit = { onCreateRepo } className = 'flex flex-col gap-4' >
361+ < input
362+ className = 'border p-3 rounded-lg'
363+ type = "text"
364+ value = { createURL }
365+ onChange = { ( e ) => setCreateURL ( e . target . value ) }
366+ placeholder = "Type Project URL (File:// or https://)"
367+ />
368+ < div className = 'flex flex-row-reverse' >
369+ < button
370+ className = 'bg-black p-3 text-white rounded-lg'
371+ type = 'submit'
372+ title = 'Create Project'
373+ >
374+ < p > Create</ p >
375+ </ button >
376+ </ div >
377+ </ form >
378+ : < Progress value = { 0 } />
379+ }
374380 </ DialogContent >
375- </Dialog> */ }
381+ </ Dialog >
382+ }
376383 </ ul >
377384 </ div >
378385 < div className = 'h-2.5 bg-gradient-to-r from-[#EC806C] via-[#B66EBD] to-[#7568F2]' />
379386 </ header >
380387 < PanelGroup direction = "horizontal" className = "w-full h-full" >
381- < Panel
382- defaultSize = { graph . Id ? 70 : 100 }
383- maxSize = { 100 }
384- minSize = { 50 }
385- >
388+ < Panel defaultSize = { 70 } className = "flex flex-col" minSize = { 50 } >
386389 < CodeGraph
387390 graph = { graph }
388391 data = { data }
0 commit comments