|
| 1 | +"use client" |
| 2 | + |
| 3 | +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/modal" |
| 4 | +import { motion } from "framer-motion" |
| 5 | + |
| 6 | +interface Editor { |
| 7 | + name: string |
| 8 | + icon: React.ReactNode |
| 9 | + href: string |
| 10 | +} |
| 11 | + |
| 12 | +// VS Code icon |
| 13 | +const VSCodeIcon = () => ( |
| 14 | + <svg viewBox="0 0 100 100" className="w-full h-full" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 15 | + <path |
| 16 | + d="M74.5 13.5L39.5 45L21.5 30.5L13.5 34V66L21.5 69.5L39.5 55L74.5 86.5L86.5 81.5V18.5L74.5 13.5Z" |
| 17 | + fill="#007ACC" |
| 18 | + /> |
| 19 | + <path d="M74.5 13.5L39.5 45L21.5 30.5L13.5 34V66L21.5 69.5L39.5 55L74.5 86.5" fill="#1F9CF0" /> |
| 20 | + <path d="M21.5 30.5L13.5 34V66L21.5 69.5V30.5Z" fill="#0065A9" /> |
| 21 | + <path d="M74.5 13.5L86.5 18.5V81.5L74.5 86.5V13.5Z" fill="#0065A9" /> |
| 22 | + </svg> |
| 23 | +) |
| 24 | + |
| 25 | +// VS Code Insiders icon |
| 26 | +const VSCodeInsidersIcon = () => ( |
| 27 | + <svg viewBox="0 0 100 100" className="w-full h-full" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 28 | + <path |
| 29 | + d="M74.5 13.5L39.5 45L21.5 30.5L13.5 34V66L21.5 69.5L39.5 55L74.5 86.5L86.5 81.5V18.5L74.5 13.5Z" |
| 30 | + fill="#24BFA5" |
| 31 | + /> |
| 32 | + <path d="M74.5 13.5L39.5 45L21.5 30.5L13.5 34V66L21.5 69.5L39.5 55L74.5 86.5" fill="#3DC9A9" /> |
| 33 | + <path d="M21.5 30.5L13.5 34V66L21.5 69.5V30.5Z" fill="#1A9E82" /> |
| 34 | + <path d="M74.5 13.5L86.5 18.5V81.5L74.5 86.5V13.5Z" fill="#1A9E82" /> |
| 35 | + </svg> |
| 36 | +) |
| 37 | + |
| 38 | +// Cursor icon |
| 39 | +const CursorIcon = () => ( |
| 40 | + <svg viewBox="0 0 100 100" className="w-full h-full" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 41 | + <rect width="100" height="100" rx="12" fill="#1E1E1E" /> |
| 42 | + <path d="M30 25L70 50L30 75V25Z" fill="none" stroke="#FFFFFF" strokeWidth="6" strokeLinejoin="round" /> |
| 43 | + </svg> |
| 44 | +) |
| 45 | + |
| 46 | +// Windsurf icon |
| 47 | +const WindsurfIcon = () => ( |
| 48 | + <svg viewBox="0 0 100 100" className="w-full h-full" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 49 | + <rect width="100" height="100" rx="12" fill="#0F0F0F" /> |
| 50 | + <path |
| 51 | + d="M25 65L40 35L55 55L75 25" |
| 52 | + fill="none" |
| 53 | + stroke="#06B6D4" |
| 54 | + strokeWidth="6" |
| 55 | + strokeLinecap="round" |
| 56 | + strokeLinejoin="round" |
| 57 | + /> |
| 58 | + <path |
| 59 | + d="M25 75L50 50L75 75" |
| 60 | + fill="none" |
| 61 | + stroke="#8B5CF6" |
| 62 | + strokeWidth="6" |
| 63 | + strokeLinecap="round" |
| 64 | + strokeLinejoin="round" |
| 65 | + /> |
| 66 | + </svg> |
| 67 | +) |
| 68 | + |
| 69 | +const editors: Editor[] = [ |
| 70 | + { |
| 71 | + name: "VS Code", |
| 72 | + icon: <VSCodeIcon />, |
| 73 | + href: "vscode:extension/RooVeterinaryInc.roo-cline", |
| 74 | + }, |
| 75 | + { |
| 76 | + name: "VS Code Insiders", |
| 77 | + icon: <VSCodeInsidersIcon />, |
| 78 | + href: "vscode-insiders:extension/RooVeterinaryInc.roo-cline", |
| 79 | + }, |
| 80 | + { |
| 81 | + name: "Cursor", |
| 82 | + icon: <CursorIcon />, |
| 83 | + href: "cursor:extension/RooVeterinaryInc.roo-cline", |
| 84 | + }, |
| 85 | + { |
| 86 | + name: "Windsurf", |
| 87 | + icon: <WindsurfIcon />, |
| 88 | + href: "windsurf:extension/RooVeterinaryInc.roo-cline", |
| 89 | + }, |
| 90 | +] |
| 91 | + |
| 92 | +interface InstallModalProps { |
| 93 | + open: boolean |
| 94 | + onOpenChange: (open: boolean) => void |
| 95 | +} |
| 96 | + |
| 97 | +export function InstallModal({ open, onOpenChange }: InstallModalProps) { |
| 98 | + return ( |
| 99 | + <Dialog open={open} onOpenChange={onOpenChange}> |
| 100 | + <DialogContent className="sm:max-w-[500px] p-6"> |
| 101 | + <DialogHeader className="text-center pb-4"> |
| 102 | + <DialogTitle className="text-2xl font-bold text-center">Install Roo Code</DialogTitle> |
| 103 | + <DialogDescription className="text-center text-muted-foreground">Select your IDE</DialogDescription> |
| 104 | + </DialogHeader> |
| 105 | + |
| 106 | + <div className="space-y-2 max-h-[60vh] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent"> |
| 107 | + {editors.map((editor, index) => ( |
| 108 | + <motion.div |
| 109 | + key={editor.name} |
| 110 | + initial={{ opacity: 0, y: 10 }} |
| 111 | + animate={{ opacity: 1, y: 0 }} |
| 112 | + transition={{ delay: index * 0.05, duration: 0.3 }} |
| 113 | + className="group relative"> |
| 114 | + <div className="relative flex items-center gap-3 p-2.5 bg-muted/30 border border-border/50 rounded-lg hover:bg-muted/50 hover:border-border transition-colors duration-150"> |
| 115 | + <div className="relative flex-shrink-0"> |
| 116 | + <div className="w-12 h-12 bg-background shadow-sm border border-border/50 rounded-lg p-2 overflow-hidden"> |
| 117 | + {editor.icon} |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + <div className="flex-grow min-w-0"> |
| 121 | + <h3 className="text-base font-semibold text-foreground">{editor.name}</h3> |
| 122 | + </div> |
| 123 | + <div className="flex items-center"> |
| 124 | + <a |
| 125 | + href={editor.href} |
| 126 | + target={editor.href.startsWith("http") ? "_blank" : undefined} |
| 127 | + rel={editor.href.startsWith("http") ? "noopener noreferrer" : undefined} |
| 128 | + className="px-4 py-2 bg-primary hover:bg-primary/90 active:bg-primary/80 text-primary-foreground text-xs font-semibold rounded-md transition-colors duration-150 shadow-sm"> |
| 129 | + Install |
| 130 | + </a> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | + </motion.div> |
| 134 | + ))} |
| 135 | + </div> |
| 136 | + </DialogContent> |
| 137 | + </Dialog> |
| 138 | + ) |
| 139 | +} |
0 commit comments