text
stringlengths
3
8.33k
repo
stringclasses
52 values
path
stringlengths
6
141
language
stringclasses
35 values
sha
stringlengths
64
64
chunk_index
int32
0
273
n_tokens
int32
1
896
'use client'; import { useEffect, useRef } from 'react'; import { useDataStream } from '@/components/data-stream-provider'; import { useScene } from '@/hooks/use-scene'; export function DataStreamHandler() { const { dataStream } = useDataStream(); const { updateProgress, setSceneResult, setError } = useScene(...
qdrant-hackathon
www/components/data-stream-handler.tsx
TypeScript
87b1679cd0ae04296d0dfe8924b7bee0e9bc0e96394c604907247b078cdba931
0
369
'use client'; import type React from 'react'; import { createContext, useContext, useMemo, useState } from 'react'; import type { DataUIPart } from 'ai'; import type { CustomUIDataTypes } from '@/lib/types'; interface DataStreamContextValue { dataStream: DataUIPart<CustomUIDataTypes>[]; setDataStream: React.D...
qdrant-hackathon
www/components/data-stream-provider.tsx
TypeScript
6d56534dd253db4d2d9b3064724e551303eb54387630d694735771d35ea36a5a
0
224
"use client" import { GithubIcon, Linkedin02Icon } from "hugeicons-react"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; import type React from "react"; interface FooterProps { logo?: { url: string; src: string; alt: string; ...
qdrant-hackathon
www/components/footer.tsx
TypeScript
459d7af558141495c1f30b4cb02b2be6164618de03ff7d6eadd206dc139dd7c6
0
896
">{section.title}</h3> <ul className="space-y-3 text-sm text-muted-foreground"> {section.links.map((link, linkIdx) => ( <li key={linkIdx}> <Link ...
qdrant-hackathon
www/components/footer.tsx
TypeScript
11c90c9f9a18ab357bb037d2e534ad742a02909f375cc8206b33496269d325a2
1
258
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet" import { Button } from './ui/button' import { AlertCircleIcon, Home12Icon, StarIcon } from 'hugeicons-react' interface FurnitureSheetProps { ikeaFurniture: any[] } const F...
qdrant-hackathon
www/components/furniture-sheet.tsx
TypeScript
6bc9a1e9679cc55f67b4125083af265f0035d1ae42110d8cbb64c161779f378b
0
896
({item.payload.rating_info.review_count}) </span> </div> )} </div> <Button asChild className="w-full" variant='outline' size="lg"> ...
qdrant-hackathon
www/components/furniture-sheet.tsx
TypeScript
1d177d592648100bd771740caeb6511afb9390d0368e1fe5a73c5557210299c0
1
158
"use client"; import { AlertCircleIcon, GithubIcon, Home12Icon, } from "hugeicons-react"; import { LoaderIcon } from "lucide-react"; import { type ReactNode, useEffect, useState } from "react"; import { buttonVariants } from "./ui/button"; import Link from "next/link"; import { cn } from "@/lib/utils"; import { ...
qdrant-hackathon
www/components/generation-progress.tsx
TypeScript
4acbfadd843567abe2ff283c47844cf3f3711fb2094dc54f5b0bcaf3dd8617e2
0
896
items-center justify-center h-dvh absolute w-dvw overflow-hidden z-10"> <div className="text-center max-w-md w-full px-6"> <div className="flex items-center justify-center"> <LoaderIcon className="size-8 animate-spin" /> </div> <h3 className="text-lg font-semibold text-secondar...
qdrant-hackathon
www/components/generation-progress.tsx
TypeScript
3d043bb6fec64486e071632eecfb2f80ad7d9b789dc8be56b423728612a445a0
1
275
"use client" import { usePathname } from 'next/navigation'; import React from 'react' import { motion } from 'motion/react'; const GradientBackground = () => { const pathname = usePathname(); if (pathname !== "/") { return null; } return ( <div className="absolute inset-0 pointer-eve...
qdrant-hackathon
www/components/gradient-background.tsx
TypeScript
4e348f93aebe22920db31bae36a60087b01a7b1028329eafe2b6221b711d8809
0
497
import { cn } from "@/lib/utils" interface HeroPillProps extends React.HTMLAttributes<HTMLDivElement> { icon?: React.ReactNode text: string className?: string /** * @default true */ animate?: boolean } export function HeroPill({ icon, text, className, animate = true, ...
qdrant-hackathon
www/components/hero-pill.tsx
TypeScript
476988e650c55948649ba501371c2d62c6c23a6cce764b65bc9656fac39038e9
0
375
"use client"; import type React from "react"; import { useState, useRef, useEffect, useCallback } from "react"; import { Plus, ArrowUp, X, FileText, ImageIcon, Video, Music, Archive, ChevronDown, Check, Loader2, AlertCircle, Copy, } from "lucide-react"; import { Butt...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
df67580fe7e809fab160babdef60d9611831a287e4864a2412020425e555ea73
0
896
, i + 1).join("")); i++; } else { clearInterval(typingEffect); onComplete?.(); } }, duration); return () => { clearInterval(typingEffect); }; }, [text, duration, onComplete]); return ( <span cla...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
818750cc4e252920e0079c4ba57b495078f31255980e1a627a7b7eb6c8547c31
1
896
| file.name.toLowerCase().includes("readme") || file.name.toLowerCase().includes("dockerfile") || file.name.toLowerCase().includes("makefile"); return isTextualMimeType || isTextualExtension; }; // Helper function to read file content as text const readFileAsText = (file: File): Promise<st...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
323b90b8f46466fb5875c6c147a937176a966aa25dc508eb6f068d156fa32b7a
2
896
file) => { if (file.size > MAX_FILE_SIZE) { alert( `File ${file.name} (${formatFileSize( file.size )}) exceeds size limit of ${formatFileSize(MAX_FILE_SIZE)}.` ); ...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
a29ea0b06e414e8998aad6c0e26fd80973f190e55aa0cf78021282124bfe5421
3
896
(/\s+/).filter(Boolean).length, }; setPastedContent((prev) => [...prev, pastedItem]); } }, [handleFileSelect, files.length, pastedContent.length, input, setInput] ); const handleDragOver = useCallback((e: React.DragEvent) => { e.preventDefaul...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
45e07f99ebd853b7a88a73d948575a3d8b91441784f7a0d7186b58c2237f6058
4
896
} value={input} onChange={(e) => setInput(e.target.value)} onPaste={handlePaste} onKeyDown={handleKeyDown} placeholder={messages.length > 0 ? "Type your message..." : ""} disabled={status !== 'ready'}...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
6cddbb9f93118c3b4d6f49033dfe677fc50c3fbfcab640f0403bc3ecce9092d9
5
896
x-auto border-t-[1px] p-3 w-full bg-card hide-scroll-bar rounded-b-xl"> <div className="flex gap-3"> {pastedContent.map((content) => ( <PastedContentCard key={content.id} ...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
7bc16893f36ed9b9343a5231e3d32c6ea12c52855f8ef152d948589f4f054e80
6
896
100" onClick={() => onRemove(file.id)} > <X className="h-4 w-4" /> </Button> </div> ); }; // Pasted Content Preview Component const PastedContentCard: React.FC<{ content: PastedContent; onRemove: (id: string) => void; }> = ({ content, onRemove...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
1e0c223472e7b56caed7ea53529d9f9c40d5702b4b5a1fdefa6d727c1e29fb1a
7
896
> {models.map((model) => ( <button key={model.id} type="button" className={cn( "w-full text-left p-2.5 rounded-md hover:bg-secondary transition-colors flex items-center justify-between...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
983918bd81be6dce1051a60a9d90f6fb36b563017bf508461f66ad6d8a500e07
8
896
file.textContent || "") } title="Copy content" > <Copy className="h-3 w-3" /> </Button> )} <Button size="icon" ...
qdrant-hackathon
www/components/multimodal-input.tsx
TypeScript
7c19565e6a7e086ff1811d3fa109e2f76118dee7629fdac25d526ee979cf00ae
9
116
"use client"; import { motion } from "motion/react"; import { usePathname } from "next/navigation"; import Link from "next/link"; import type React from "react"; import { useRef, useState } from "react"; interface NavItem { name: string; href: string; } const navs: NavItem[] = [ { name: "Home", href: "...
qdrant-hackathon
www/components/nav-menu.tsx
TypeScript
09b49578787247d6a9bf824a97b71487bab589a1ad118b4dece4ecbbcc72c6f4
0
501
"use client"; import { NavMenu } from "@/components/nav-menu"; import { cn } from "@/lib/utils"; import { GithubIcon } from "hugeicons-react"; import { Menu, X } from "lucide-react"; import { AnimatePresence, motion, useScroll } from "motion/react"; import Image from "next/image"; import Link from "next/link"; import ...
qdrant-hackathon
www/components/navbar.tsx
TypeScript
0b70501e4e008e43b720027c12434f943dc08132268b1ed55b91ad1d31599e3f
0
896
cursor-pointer flex items-center justify-center" onClick={toggleDrawer} > {isDrawerOpen ? ( <X className="size-5" /> ) : ( <Menu className="size-5" /> )} </button> </div> </div> {/* Mobile Drawer */} ...
qdrant-hackathon
www/components/navbar.tsx
TypeScript
86efafa275d6c1de50fce640b2d695e7363f650cec70d79dddf20f13cbcb7f26
1
537
"use client" import { useTheme } from 'next-themes'; import GrainImage from "@/public/grain.png"; import { usePathname } from 'next/navigation'; const NoiseBackground = () => { const { theme } = useTheme(); const pathname = usePathname(); if (pathname.startsWith('/scene/')) { return null; } ...
qdrant-hackathon
www/components/noise-background.tsx
TypeScript
9461c2b7df4873f1eb2626103f44600a77a5dd5a33a25492dff3fd3c81045934
0
161
> <p className="text-xs text-muted-foreground"> Created {formatDistanceToNow(new Date(createdAt), { addSuffix: true })} </p> </div> </Link> )) const PersonalScenes = ({ isMinified = false }: PersonalScenesProps) => { const [isMounted, setIsMounted] = useState(fal...
qdrant-hackathon
www/components/personal-scenes.tsx
TypeScript
ea40aa985047f3121d50ba656febdcbdb1362408dbdf2dacf151b72479c5fa7c
1
896
View All</Link> </Button> )} </div> <div className='grid grid-cols-1 md:grid-cols-3 gap-3 my-3'> {validScenes.map((scene) => ( <SceneCard key={scene.id} scene={scene} ...
qdrant-hackathon
www/components/personal-scenes.tsx
TypeScript
987e46ce20ccfd9aa13625396e880f248e4e6706dd477046fe1b9532a4f2a54e
2
524
"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { Switch } from "@/components/ui/switch"; import { Separator } from "@/components/ui/separator"; import { Tooltip, TooltipContent, T...
qdrant-hackathon
www/components/preferences-popover.tsx
TypeScript
0f20a274f5b90fca54fe5b077a7ea56360fd202da513c62835c2ae6cbc2715b1
0
677
import type { Attachment } from '@/lib/types'; import { Loader } from 'lucide-react'; import { X } from 'lucide-react'; import { Button } from './ui/button'; export const PreviewAttachment = ({ attachment, isUploading = false, onRemove, onEdit, }: { attachment: Attachment; isUploading?: boolean...
qdrant-hackathon
www/components/preview-attachment.tsx
TypeScript
5eeeaa4d95eae2c55ad77a43f4585a165979196e8f7c5b6d5c50b1471743e2d7
0
421
'use client'; import { Button } from '@/components/ui/button'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { Textarea } from '@/components/ui/textarea'; import { cn } from '@/lib/utils'; import type { ChatStatus } from 'ai'; import...
qdrant-hackathon
www/components/prompt-input.tsx
TypeScript
062ae9b9ed43cdd9a21b1778bc826d78f3f826a612f95d6bc9c5097d91d7d75e
0
896
'default', size = 'icon', status, children, ...props }: PromptInputSubmitProps) => { let Icon = <SendIcon className="size-4" />; if (status === 'submitted') { Icon = <Loader2Icon className="size-4 animate-spin" />; } else if (status === 'streaming') { Icon = <SquareIcon clas...
qdrant-hackathon
www/components/prompt-input.tsx
TypeScript
0dcfd79bb5b2bdc161c71bdf3d76021ddae9d079bce8c30ad8c4b7b777a6ad89
1
479
'use client' import { ArrowDown01Icon, CursorInfo01Icon, Location06Icon, LocationOffline01Icon, Share08Icon } from 'hugeicons-react' import Link from 'next/link' import { Button } from './ui/button' import FurnitureSheet from './furniture-sheet' import Image from 'next/image' import { motion, AnimatePresence } from 'm...
qdrant-hackathon
www/components/scene-controlls.tsx
TypeScript
ab373bdccad6a89a27d2c0d61f36494bc8f6cc22c8d5127515608e1b2f9cd4a8
0
896
)} className='h-8 w-8 p-0 hover:bg-white/10 transition-colors' > <motion.div animate={{ rotate: isExpanded ? 180 : 0 }} transition={{ duration: 0.3, ease: 'easeOut' }} > <ArrowDown01Icon className='size-4' /> ...
qdrant-hackathon
www/components/scene-controlls.tsx
TypeScript
d48130797eec1ef0d968ea4f546651215e0b9a9b4c1b0aa06c6a4ce0b9e12999
1
567
"use client"; import { cn } from "@/lib/utils"; import Link from "next/link"; export function SceneHeader() { return ( <header className="absolute w-full top-0 h-12 z-50 p-0 bg-black/50 backdrop-blur border-b border-white/[0.05]"> <div className="flex justify-between items-center p-2 px-4"> ...
qdrant-hackathon
www/components/scene-header.tsx
TypeScript
9864675387a380c1a9dbf17271fab2767aa201e3f37cdfe9f5116cd3e260da05
0
199
"use client"; import { useEffect, useCallback, useState, useMemo, memo } from "react"; // @ts-ignore import { Pannellum } from "pannellum-react"; import { useScene } from "@/hooks/use-scene"; import { Conversation, ConversationContent } from "./conversation"; import { useMessages } from "@/hooks/use-messages"; import ...
qdrant-hackathon
www/components/scene.tsx
TypeScript
ab1a542b34e1df522bb3e52dd5331006f79fb456f1d88f06dd22629d0bc4cff8
0
896
} catch (error) { console.error("Error processing image:", error); setImageUrl(null); } }, []); useEffect(() => { processImage(sceneResults); }, [sceneResults, processImage]); const handlePanoramaLoad = useCallback(() => { console.log("panorama loaded"); }, []); const handlePanora...
qdrant-hackathon
www/components/scene.tsx
TypeScript
d03cb5bd13d450b7e9aa237d0cb887013bced38470e66579453f531d17d9199e
1
896
="" previewAuthor="" previewTitle="" hotspotDebug={false} showControls={false} onLoad={handlePanoramaLoad} onError={handlePanoramaError} onErrorcleared={handlePanoramaErrorCleared} > {hotspots.map((hotspot, index) ...
qdrant-hackathon
www/components/scene.tsx
TypeScript
cc8894f3ae3eed9319551800b52a1811d4b1545a8469cef6632d24a0ab9de17e
2
142
import type { Scene } from '@/lib/db/schema'; import { SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, } from './ui/sidebar'; import Link from 'next/link'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent...
qdrant-hackathon
www/components/sidebar-history-item.tsx
TypeScript
9314625d4e33c9c2753b3db0581b92462aa1d18759d37dc36319768c8c3a2bb3
0
698
'use client'; import { isToday, isYesterday, subMonths, subWeeks } from 'date-fns'; import { useParams, useRouter } from 'next/navigation'; import type { User } from 'next-auth'; import { useState } from 'react'; import { toast } from 'sonner'; import { motion } from 'motion/react'; import { AlertDialog, Alert...
qdrant-hackathon
www/components/sidebar-history.tsx
TypeScript
2ec39338c2959186e6db2ca7f5d45a4cd6ab75910767b28f5e36572ea9dac995
0
896
, error: 'Failed to delete chat', }); setShowDeleteDialog(false); if (deleteId === id) { router.push('/'); } }; if (!user) { return ( <SidebarGroup> <SidebarGroupContent> <div className="px-2 text-...
qdrant-hackathon
www/components/sidebar-history.tsx
TypeScript
f6862c41ea988f72f7610a294e3b14986cbe99a158fe643fb4554058595c63d2
1
896
.lastMonth.map((scene) => ( <SceneItem key={scene.id} scene={scene} isActive={scene.id === id} ...
qdrant-hackathon
www/components/sidebar-history.tsx
TypeScript
3093c350a9c25a2568bc4ecca5926d9641b59932acb41b78aa0995f45775dc4e
2
487
'use client'; import { useFormStatus } from 'react-dom'; import { LoaderIcon } from 'lucide-react'; import { Button } from './ui/button'; export function SubmitButton({ children, isSuccessful, }: { children: React.ReactNode; isSuccessful: boolean; }) { const { pending } = useFormStatus(); r...
qdrant-hackathon
www/components/submit-button.tsx
TypeScript
5b6b9bfc40c2c05149c3ce754969ac6715442574d342f854f02c880f56167b12
0
195
"use client" import { useState, useEffect, useCallback, useMemo, memo } from 'react' import dynamic from 'next/dynamic' import { Button } from './ui/button' import { Input } from './ui/input' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select' import { PlusSignIcon, ArrowLeft01Ic...
qdrant-hackathon
www/components/unified-scenes.tsx
TypeScript
7ce6d31edeca87083379981fa580d6b242d26da6c7883a7b5c7be9feb4c3c2c0
0
896
{isPersonal && ( <div className="absolute top-2 left-2 bg-card text-primary text-xs px-2 py-1 rounded-md"> Your Scene </div> )} */} </div> <div className="p-3"> <h3 className="font-medium text-sm line-clamp-2 group-hover:text-pr...
qdrant-hackathon
www/components/unified-scenes.tsx
TypeScript
f2b171988de423c96bbf1067cf6855e9fd13b009e2df12bba4095e7da11fb879
1
896
image && scene.latestMessagePart[0].data?.scene?.createdAt ) .map(scene => ({ ...scene, base64Image: scene.latestMessagePart![0].data.scene.image, createdAt: scene.latestMessagePart![0].data.scene.createdAt })) }, [p...
qdrant-hackathon
www/components/unified-scenes.tsx
TypeScript
cef6b6a9261c46feb44ef42fdaf8d076125152bc4e19fb2bda2b2bd6c8617abf
2
896
text-center"> <div className="w-16 h-16 bg-muted rounded-full flex items-center justify-center mb-4"> <PlusSignIcon className="h-8 w-8 text-muted-foreground" /> </div> <h3 className="text-lg font-semibold mb-2">No scenes yet</h3> ...
qdrant-hackathon
www/components/unified-scenes.tsx
TypeScript
1a06c8b4f5e47a5e9352e8304a0b5422d55693bf0e66d40af138a748e3ba5580
3
896
id} scene={scene} image={scene.base64Image} createdAt={scene.createdAt} /> ))} </div> </div> {!isMinified && ( <div className="flex ite...
qdrant-hackathon
www/components/unified-scenes.tsx
TypeScript
d5a41e26a7cd13b69d3787eced18c45af4cf0a4fcc90803ffba08161735e7b6e
4
490
'use client'; import type React from 'react'; import { useRef, useMemo, useState, useEffect } from 'react'; import { Canvas, useFrame, useThree } from '@react-three/fiber'; import { OrbitControls, Stats } from '@react-three/drei'; import * as THREE from 'three'; import { Button } from '@/components/ui/button'; import ...
qdrant-hackathon
www/components/vector-visualization.tsx
TypeScript
4be707d940fe0e87efd69aa4af74b35f04b80c5e4e72ee552c26181f9f0521fb
0
896
; uniform float uTime; uniform float uHoveredIndex; void main() { vColor = color; vSize = size; vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); float pointSize = size * (400.0 / -mvPosition.z); if (uHoveredIndex >= 0.0) { pointSize *= ...
qdrant-hackathon
www/components/vector-visualization.tsx
TypeScript
ae998fcdbfb928cdaa8ccec6d7b1deb530be502fdf949e00be84dcbc8705f0d8
1
896
); } if (error) { return ( <div className="absolute top-4 left-4 w-64 bg-card border border-destructive rounded-lg p-4"> <p className="text-destructive text-sm">Error: {error}</p> </div> ); } return ( <div className="absolute top-4 left-4...
qdrant-hackathon
www/components/vector-visualization.tsx
TypeScript
f16740a1dbe57752c6b212da128ba82744879ca3fd7a3f2ce754c7e2118d38fe
2
896
-1"> <span className="text-xs text-muted-foreground uppercase tracking-wide">Price</span> <p className="text-green-600 font-semibold">${point.payload.price}</p> </div> )} <div className="space-y-1"> ...
qdrant-hackathon
www/components/vector-visualization.tsx
TypeScript
fd0a45d8de0fb56223f291fb6ac1ab098ed79a95b358db11fa3c95955267db63
3
896
('keydown', handleKeyDown); }, []); return ( <div className="w-full h-screen bg-background relative"> <Canvas camera={{ position: [0, 0, 50], fov: 60 }} dpr={[1, 2]} performance={{ min: 0.5 }} gl={{ antialia...
qdrant-hackathon
www/components/vector-visualization.tsx
TypeScript
7ab45e8c7c8fa779694ff56071da6ec6d9a0a9b325ae8797e9824c4e1e807a8d
4
599
'use client'; import { type ReactNode, useMemo, useState } from 'react'; import { Button } from '@/components/ui/button'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { cn } from '@/lib/utils'; import { CheckCircle...
qdrant-hackathon
www/components/visibility-selector.tsx
TypeScript
d996cefaba8799a0e0d8034187e35330bcd38ff9a733508d2a1eb78ccb1239c6
0
665
"use client"; import type * as React from "react"; import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"; import { cn } from "@/lib/utils"; import { buttonVariants } from "@/components/ui/button"; function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) { return <...
qdrant-hackathon
www/components/ui/alert-dialog.tsx
TypeScript
99ea7297f2124606205e2465a592ace6616778ea07eccdeb1af9725c45b01485
0
896
} {...props} /> ); } function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) { return ( <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} /> ); } function AlertDialogCancel({ className, ...
qdrant-hackathon
www/components/ui/alert-dialog.tsx
TypeScript
742500a8c259e9f498af5f075a7b723b7f49bc958e8024f984e7fe16273d7730
1
149
import type * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transitio...
qdrant-hackathon
www/components/ui/button.tsx
TypeScript
504b4494bd76e90b0005628df14b9263ab0cab11340b42932cc162d4838bd70e
0
602
"use client"; import type * as React from "react"; import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"; import { cn } from "@/lib/utils"; function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive....
qdrant-hackathon
www/components/ui/dropdown-menu.tsx
TypeScript
2de72b42bd1f17a5817a39db80d4176437d17a70cdb864957a77c8418bc08791
0
896
class*='size-'])]:size-4", className, )} {...props} /> ); } function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) { return ( <DropdownMenuPrimitive.CheckboxItem data-slot="dropdown-men...
qdrant-hackathon
www/components/ui/dropdown-menu.tsx
TypeScript
bdc0853ef6b8b30bd4422d370ca4adbd05f0f352b4b173b4afeb0e2882b01d36
1
896
"dropdown-menu-sub" {...props} />; } function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean; }) { return ( <DropdownMenuPrimitive.SubTrigger data-slot="dropdown-menu-sub-trigger" data-inset=...
qdrant-hackathon
www/components/ui/dropdown-menu.tsx
TypeScript
bf41d2cd45c28a974bcee03b5fb95f046a32b135b80ffa0d1f8f5b7d7ff2755e
2
483
import type * as React from "react"; import { cn } from "@/lib/utils"; function Input({ className, type, ...props }: React.ComponentProps<"input">) { return ( <input type={type} data-slot="input" className={cn( "file:text-foreground placeholder:text-muted-foreground selection:bg-primar...
qdrant-hackathon
www/components/ui/input.tsx
TypeScript
c8eae89e1100e2526a0295016295ef0cac381b31f74c5e28dd18a8774195b9b5
0
281
"use client"; import type * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { cn } from "@/lib/utils"; function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) { return ( <LabelPrimitive.Root data-slot="label" className={cn...
qdrant-hackathon
www/components/ui/label.tsx
TypeScript
8a78769ac74f9b8df7500df0fe9f31b39be3f509fde22eb77623c72631400eea
0
171
"use client"; import type * as React from "react"; import * as PopoverPrimitive from "@radix-ui/react-popover"; import { cn } from "@/lib/utils"; function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) { return <PopoverPrimitive.Root data-slot="popover" {...props} />; } function Popov...
qdrant-hackathon
www/components/ui/popover.tsx
TypeScript
49804ff810b22c16aa9632f4188b7d31f7ad5e34d43291a5aff62c51e355ad56
0
464
"use client"; import type * as React from "react"; import * as ProgressPrimitive from "@radix-ui/react-progress"; import { cn } from "@/lib/utils"; function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>) { return ( <ProgressPrimitive.Root data-slot="pr...
qdrant-hackathon
www/components/ui/progress.tsx
TypeScript
b10b28500be9aa2c83721c58f567bedda8a239b9366dea250882a044588e1b4d
0
193
"use client"; import type * as React from "react"; import * as SelectPrimitive from "@radix-ui/react-select"; import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"; import { cn } from "@/lib/utils"; function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) { return <Sele...
qdrant-hackathon
www/components/ui/select.tsx
TypeScript
adc3ce39f5f46a5133cc2ec3230ae874ac5731e222778affe59177e541e73c68
0
896
"use client"; import type * as React from "react"; import * as SeparatorPrimitive from "@radix-ui/react-separator"; import { cn } from "@/lib/utils"; function Separator({ className, orientation = "horizontal", decorative = true, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>) { return ( ...
qdrant-hackathon
www/components/ui/separator.tsx
TypeScript
a75f3cf8a62e55995070f63df15e5befce2bdc376ebc1f9b4a48bcb529dd0786
0
178
"use client"; import type * as React from "react"; import * as SheetPrimitive from "@radix-ui/react-dialog"; import { XIcon } from "lucide-react"; import { cn } from "@/lib/utils"; function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) { return <SheetPrimitive.Root data-slot="sheet" {...pro...
qdrant-hackathon
www/components/ui/sheet.tsx
TypeScript
5455cde87ed5d971ed5e75377e63a2caf48ba248b2db4564eaa09ba4b25506fc
0
896
disabled:pointer-events-none"> <XIcon className="size-4" /> <span className="sr-only">Close</span> </SheetPrimitive.Close> </SheetPrimitive.Content> </SheetPortal> ); } function SheetHeader({ className, ...props }: React.ComponentProps<"div">) { return ( <div data-sl...
qdrant-hackathon
www/components/ui/sheet.tsx
TypeScript
2c80437ef458fab44819a03f2be00154464d3ab48679d799ec4fc0badc6ecef5
1
345
import { cn } from "@/lib/utils"; function Skeleton({ className, ...props }: React.ComponentProps<"div">) { return ( <div data-slot="skeleton" className={cn("bg-accent animate-pulse rounded-md", className)} {...props} /> ); } export { Skeleton };
qdrant-hackathon
www/components/ui/skeleton.tsx
TypeScript
1f75b999a5ad2f65e8fb807faa2b3fccef9eb333996fb4c9030575dac7393091
0
82
"use client"; import { useTheme } from "next-themes"; import { Toaster as Sonner, type ToasterProps } from "sonner"; const Toaster = ({ ...props }: ToasterProps) => { const { theme = "system" } = useTheme(); return ( <Sonner theme={theme as ToasterProps["theme"]} className="toaster group" s...
qdrant-hackathon
www/components/ui/sonner.tsx
TypeScript
a62cd60f6c42c13acefef2b049be3a00d343f6dc9047a018131fbb5321e3272d
0
161
"use client"; import type * as React from "react"; import * as SwitchPrimitive from "@radix-ui/react-switch"; import { cn } from "@/lib/utils"; function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) { return ( <SwitchPrimitive.Root data-slot="switch" classNa...
qdrant-hackathon
www/components/ui/switch.tsx
TypeScript
f3a015e1e9b26248be0bcb4b8fa791494d897412e48073d811ff0f59886e13f5
0
332
import type * as React from "react"; import { cn } from "@/lib/utils"; function Textarea({ className, ...props }: React.ComponentProps<"textarea">) { return ( <textarea data-slot="textarea" className={cn( "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible...
qdrant-hackathon
www/components/ui/textarea.tsx
TypeScript
f9dcf6c0b46dea75bb98d6c455eeab2bcc27e5960761dc638373afdf8883de99
0
216
"use client"; import { useMemo } from "react"; import useSWR, { useSWRConfig } from "swr"; import { unstable_serialize } from "swr/infinite"; import { updateSceneVisibility } from "@/app/(scene)/actions"; import type { VisibilityType } from "@/components/visibility-selector"; import { getSceneHistoryPaginationKey, ...
qdrant-hackathon
www/hooks/use-chat-visibility.ts
TypeScript
1e76f79245f875ba5bbe8d0db9f8899c0582ae15f642b4b080c9afe44a58bf21
0
290
import { useState, useEffect } from "react"; import { useScrollToBottom } from "./use-scroll-to-bottom"; import type { UseChatHelpers } from "@ai-sdk/react"; import type { ChatMessage } from "@/lib/types"; export function useMessages({ sceneId, status, }: { sceneId: string; status: UseChatHelpers<ChatMessage>[...
qdrant-hackathon
www/hooks/use-messages.tsx
TypeScript
a3ade475461de4bed4bf911e673a272cd9727541d588fa91bc1aa72c8e86816a
0
204
"use client"; import { type ReactNode, useCallback, useMemo } from "react"; import useSWR from "swr"; export interface SceneData { id: string; title: string | null; image: string | null; prompt: string | null; isLoading: boolean; progress: number; statusMessage: string | null; error: string | null; ...
qdrant-hackathon
www/hooks/use-scene.ts
TypeScript
17f2355ae753f98201b60fb445607ae8d93dfa8aa368149661d4c9ab20e6de74
0
549
import useSWR from "swr"; import { useRef, useEffect, useCallback } from "react"; type ScrollFlag = ScrollBehavior | false; export function useScrollToBottom() { const containerRef = useRef<HTMLDivElement>(null); const endRef = useRef<HTMLDivElement>(null); const { data: isAtBottom = false, mutate: setIsAtBott...
qdrant-hackathon
www/hooks/use-scroll-to-bottom.tsx
TypeScript
cdac46531032903b92f233726a8a7dd1e2453a58c4b86fa1f53d614090648da5
0
235
import { generateDummyPassword } from "./db/utils"; export const isProductionEnvironment = process.env.NODE_ENV === "production"; export const isDevelopmentEnvironment = process.env.NODE_ENV === "development"; export const isTestEnvironment = Boolean( process.env.PLAYWRIGHT_TEST_BASE_URL || process.env.PLAYWRIGH...
qdrant-hackathon
www/lib/constants.ts
TypeScript
2499d0e85d5d7b4729ea8a9975c76368c7f7113e2e38c091117b38021e3abc99
0
95
export type ErrorType = | "bad_request" | "unauthorized" | "forbidden" | "not_found" | "rate_limit" | "offline"; export type Surface = | "chat" | "auth" | "api" | "stream" | "database" | "history" | "vote" | "document" | "suggestions"; export type ErrorCode = `${ErrorType}:${Surface}`; ...
qdrant-hackathon
www/lib/errors.ts
TypeScript
43321645e73f812322127df6eda320bca3d9a4187df6b04887b3d31edc24be1c
0
840
import { z } from "zod"; import type { UIMessage } from "ai"; import type { ReactNode } from "react"; import type { SceneGenerationResult } from "./scene"; export type DataPart = { type: "append-message"; message: string }; export const messageMetadataSchema = z.object({ createdAt: z.string(), }); export type Mess...
qdrant-hackathon
www/lib/types.ts
TypeScript
023b2595c2f6e6788b644ae1aed9ac3324cb1bf36d7a207eb50b917101aef0a9
0
684
import type { CoreAssistantMessage, CoreToolMessage, UIMessage, UIMessagePart, } from "ai"; import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; import type { DBMessage } from "@/lib/db/schema"; import { ChatSDKError, type ErrorCode } from "@/lib/errors"; import type { ChatMes...
qdrant-hackathon
www/lib/utils.ts
TypeScript
10535ec760e342b6bf163ece5d567150fdb6982a5f93e3ac0a46e23a84e65edf
0
896
base64 string (with or without data URL prefix) * @param mimeType - The MIME type of the image (defaults to 'image/png') * @returns A blob URL that can be used as an image source */ export const base64ToBlobUrl = ( base64String: string, mimeType: string = "image/png", ): string => { if (typeof base64String !==...
qdrant-hackathon
www/lib/utils.ts
TypeScript
607a45efb2caca089b8b56d5b8eaeb82d7089ff8870939e967580c9de28fb462
1
530
import type { UserType } from "@/app/(auth)/auth"; import type { ChatModel } from "@/lib/ai/models"; interface Entitlements { maxMessagesPerDay: number; availableChatModelIds: Array<ChatModel["id"]>; } export const entitlementsByUserType: Record<UserType, Entitlements> = { /* * For users without an account ...
qdrant-hackathon
www/lib/ai/entitlements.ts
TypeScript
1fa0ed296e72ae575fdee04ca50a5a78e5346a0f73c3ac2c7a5d54b51aa2f3bd
0
162
export const DEFAULT_CHAT_MODEL: string = "chat-model-mistral"; export interface ChatModel { id: string; name: string; description: string; icon: string; } export const chatModels: Array<ChatModel> = [ { id: "chat-model-mistral", name: "Pixtral 12b", description: "Frontier model from Mistral", ...
qdrant-hackathon
www/lib/ai/models.ts
TypeScript
1404ab7f69f9725f6333076022e7d1a81ed8fcdc4a62c5a18ff1bd60f5411b35
0
125
import type { Geo } from "@vercel/functions"; export const regularPrompt = "You are a friendly assistant! Keep your responses concise and helpful."; export interface RequestHints { latitude: Geo["latitude"]; longitude: Geo["longitude"]; city: Geo["city"]; country: Geo["country"]; } export const getRequestP...
qdrant-hackathon
www/lib/ai/prompts.ts
TypeScript
79be721458f9b9caf19ec85658cb6f9e4ec2e0979bb2d90fc2da27b03a855b59
0
186
import { customProvider, } from "ai"; import { openai } from "@ai-sdk/openai"; import { mistral } from "@ai-sdk/mistral"; import { artifactModel, chatModel, reasoningModel, titleModel, } from "./models.test"; import { isTestEnvironment } from "@/lib/constants"; export const myProvider = isTestEnvironment ?...
qdrant-hackathon
www/lib/ai/providers.ts
TypeScript
7f3cd706ba42d848db7316de8a0f41ee2f558771108c5f432bc20cb56020864c
0
232
import { generateId, type ModelMessage } from "ai"; import { TEST_PROMPTS } from "@/lib/ai/basic"; import type { LanguageModelV2StreamPart } from "@ai-sdk/provider"; export function compareMessages( firstMessage: ModelMessage, secondMessage: ModelMessage, ): boolean { if (firstMessage.role !== secondMessage.role...
qdrant-hackathon
www/lib/ai/utils.ts
TypeScript
f13a0f1b990591460d0bfce9b676a08fe03c74c198ee3cf4a06d1d9aa3031051
0
896
) { return [ { type: "tool-call", toolCallId: "call_456", toolName: "getWeather", input: JSON.stringify({ latitude: 37.7749, longitude: -122.4194 }), }, { type: "finish", finishReason: "stop", usage: { inputTokens: 3, outputTokens: 10, totalT...
qdrant-hackathon
www/lib/ai/utils.ts
TypeScript
71a7166da4d002c690554d6c89d6ce13500094fa8ef654c4b98773c0aac34dcc
2
178
import "server-only"; import { and, asc, count, desc, eq, gt, gte, inArray, lt, type SQL, } from "drizzle-orm"; import { drizzle } from "drizzle-orm/postgres-js"; import postgres from "postgres"; import { user, scene, type User, message, vote, type DBMessage, stream, } from "./schema...
qdrant-hackathon
www/lib/db/queries.ts
TypeScript
1b53dedecbfbb30a5efc8b807ee85a82fb925d079cf82542cf6d468a5be3cb6a
0
896
id)) : eq(scene.userId, id), ) .orderBy(desc(scene.createdAt)) .limit(extendedLimit); let filteredScenes: Array<{ id: string; title: string; visibility: VisibilityType; createdAt: Date; userId: string; }> = []; if (startingAfter) { co...
qdrant-hackathon
www/lib/db/queries.ts
TypeScript
0ea88acc77c6e44a3367209b5c8f382912b08be96653073fc0dffafd47ccfddc
1
896
.select().from(vote).where(eq(vote.sceneId, id)); } catch { throw new ChatSDKError( "bad_request:database", "Failed to get votes by scene id", ); } } export async function getMessageById({ id }: { id: string }) { try { return await db.select().from(message).where(eq(message.id, id)); } ...
qdrant-hackathon
www/lib/db/queries.ts
TypeScript
17dde32cb5c9d6ccf3abb128c0a04d261b2db38e83d4421405bdfbbbfb81efe5
2
896
; if (messageIds.length > 0) { await db .delete(vote) .where( and(eq(vote.sceneId, sceneId), inArray(vote.messageId, messageIds)), ); return await db .delete(message) .where( and(eq(message.sceneId, sceneId), inArray(message.id, messageIds)),...
qdrant-hackathon
www/lib/db/queries.ts
TypeScript
baa8dd56b49439ff12b5a991e07efc8b6ebe03a2f460db4e011e9a9586cb3bc0
3
637
import type { InferSelectModel } from "drizzle-orm"; import { pgTable, varchar, timestamp, json, uuid, text, primaryKey, foreignKey, boolean, } from "drizzle-orm/pg-core"; export const user = pgTable("User", { id: uuid("id").primaryKey().notNull().defaultRandom(), email: varchar("email", { length...
qdrant-hackathon
www/lib/db/schema.ts
TypeScript
55c968c2f1681168bcee019982457845456d8551bd49d3f42adc85668b794922
0
896
("sceneId").notNull(), createdAt: timestamp("createdAt").notNull(), }, (table) => ({ pk: primaryKey({ columns: [table.id] }), sceneRef: foreignKey({ columns: [table.sceneId], foreignColumns: [scene.id], }), }), ); export type Stream = InferSelectModel<typeof stream>;
qdrant-hackathon
www/lib/db/schema.ts
TypeScript
80de711f31c42385871ca04bc94d7b97efa2ff0e5c56439b1102e43bf53a945d
1
86
CREATE TABLE "Message_v2" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "sceneId" uuid NOT NULL, "role" varchar NOT NULL, "parts" json NOT NULL, "attachments" json NOT NULL, "createdAt" timestamp NOT NULL ); --> statement-breakpoint CREATE TABLE "Message" ( "id" uuid PRIMARY KEY DEFAULT gen_random_...
qdrant-hackathon
www/lib/db/migrations/0000_greedy_eternals.sql
SQL
539a5b7ce9ee3c050d9632c4c4ce81b1e5db77908963f43773d154068cae78c5
0
721
ALTER TABLE "Stream" ALTER COLUMN "id" SET DATA TYPE varchar(64);--> statement-breakpoint ALTER TABLE "Stream" ALTER COLUMN "id" DROP DEFAULT;
qdrant-hackathon
www/lib/db/migrations/0001_funny_whiplash.sql
SQL
4d63f6ec07dc40ea94e7c06e2337a751916fb21eb904437265b651577d17faa9
0
37
ALTER TABLE "Scene" ALTER COLUMN "id" SET DATA TYPE varchar(100);--> statement-breakpoint ALTER TABLE "Scene" ALTER COLUMN "id" DROP DEFAULT;--> statement-breakpoint ALTER TABLE "Stream" ALTER COLUMN "id" SET DATA TYPE uuid;--> statement-breakpoint ALTER TABLE "Stream" ALTER COLUMN "id" SET DEFAULT gen_random_uuid();
qdrant-hackathon
www/lib/db/migrations/0002_familiar_jean_grey.sql
SQL
7b9f478bd32988e15d5a4ab45257a45b08ecb93ded5c7ac188824d3fda772431
0
80
ALTER TABLE "Message_v2" ALTER COLUMN "sceneId" SET DATA TYPE varchar(100);--> statement-breakpoint ALTER TABLE "Message" ALTER COLUMN "sceneId" SET DATA TYPE varchar(100);--> statement-breakpoint ALTER TABLE "Stream" ALTER COLUMN "sceneId" SET DATA TYPE varchar(100);--> statement-breakpoint ALTER TABLE "Vote_v2" ALTER...
qdrant-hackathon
www/lib/db/migrations/0003_special_wendell_rand.sql
SQL
ac5c248a64a152b81f860affcb415c681c5ebe840b353a6c9d36f65ef8034947
0
114
ALTER TABLE "Message_v2" ALTER COLUMN "sceneId" SET DATA TYPE uuid;--> statement-breakpoint ALTER TABLE "Message" ALTER COLUMN "sceneId" SET DATA TYPE uuid;--> statement-breakpoint ALTER TABLE "Scene" ALTER COLUMN "id" SET DATA TYPE uuid;--> statement-breakpoint ALTER TABLE "Scene" ALTER COLUMN "id" SET DEFAULT gen_ran...
qdrant-hackathon
www/lib/db/migrations/0004_green_marrow.sql
SQL
b12e1de1b4481536997c4c527fa4be918d034a5ef772d4911dd4e09cf66accba
0
142
import { relations } from "drizzle-orm/relations"; import { user, scene, messageV2, message, stream, voteV2, vote, } from "./schema"; export const sceneRelations = relations(scene, ({ one, many }) => ({ user: one(user, { fields: [scene.userId], references: [user.id], }), messageV2s: many(me...
qdrant-hackathon
www/lib/db/migrations/relations.ts
TypeScript
96332e32d8ec1ac597a117bcafc48b9bec13b364356ed9dae3ae96bac71bf70c
0
454
import { pgTable, foreignKey, uuid, timestamp, text, varchar, json, primaryKey, boolean, } from "drizzle-orm/pg-core"; export const scene = pgTable( "Scene", { id: uuid().defaultRandom().primaryKey().notNull(), createdAt: timestamp({ mode: "string" }).notNull(), title: text().notNull(...
qdrant-hackathon
www/lib/db/migrations/schema.ts
TypeScript
5fb85f90b1c3309c865aa1137924b0637e287802f13dbf133b6344df168e60cf
0
817
{ "id": "52f31096-c670-4cf2-af2f-fde1402c95af", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.Message_v2": { "name": "Message_v2", "schema": "", "columns": { "id": { "name": "id", "type": "uuid",...
qdrant-hackathon
www/lib/db/migrations/meta/0000_snapshot.json
JSON
463bf72eb278da5d9f19c6cfd20d2310e9ce1d6e8987beb27bc6cdf08a69f545
0
896
": false, "notNull": true }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true }, "userId": { "name": "userId", "type": "uuid", "primaryKey": false, "notNull": true ...
qdrant-hackathon
www/lib/db/migrations/meta/0000_snapshot.json
JSON
622e40bb5ccb787ade7b36ef06ac8e36c8ba59514fc24f3280d5651badb39d88
1
896