@@ -12,13 +12,16 @@ import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
12
12
import Image from 'next/image' ;
13
13
import { DropdownMenu , DropdownMenuContent , DropdownMenuLabel , DropdownMenuTrigger } from '@/components/ui/dropdown-menu' ;
14
14
import { prepareArg } from './utils' ;
15
+ import { Dialog , DialogContent , DialogDescription , DialogHeader , DialogTitle , DialogTrigger } from '@/components/ui/dialog' ;
16
+ import { Progress } from '@/components/ui/progress' ;
15
17
import { Carousel , CarouselApi , CarouselContent , CarouselItem , CarouselNext , CarouselPrevious } from '@/components/ui/carousel' ;
16
18
import { Drawer , DrawerContent , DrawerDescription , DrawerTitle , DrawerTrigger } from '@/components/ui/drawer' ;
17
19
import Input from './components/Input' ;
18
20
import { ForceGraphMethods , NodeObject } from 'react-force-graph-2d' ;
19
21
import { Labels } from './components/labels' ;
20
22
import { Toolbar } from './components/toolbar' ;
21
23
import { cn , handleZoomToFit , Message , Path , PathData , PathNode } from '@/lib/utils' ;
24
+ import { GraphContext } from './components/provider' ;
22
25
23
26
type Tip = {
24
27
title : string
@@ -118,6 +121,7 @@ export default function Home() {
118
121
title : "Uh oh! Something went wrong." ,
119
122
description : await result . text ( ) ,
120
123
} )
124
+ setIsSubmit ( false )
121
125
return
122
126
}
123
127
@@ -329,60 +333,59 @@ export default function Home() {
329
333
}
330
334
</ DropdownMenuContent >
331
335
</ 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'>
346
336
{
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
+ }
374
380
</ DialogContent >
375
- </Dialog> */ }
381
+ </ Dialog >
382
+ }
376
383
</ ul >
377
384
</ div >
378
385
< div className = 'h-2.5 bg-gradient-to-r from-[#EC806C] via-[#B66EBD] to-[#7568F2]' />
379
386
</ header >
380
387
< 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 } >
386
389
< CodeGraph
387
390
graph = { graph }
388
391
data = { data }
0 commit comments