11import React from "react" ;
22import { Button } from "@/components/ui/button" ;
3+ import {
4+ DropdownMenu ,
5+ DropdownMenuContent ,
6+ DropdownMenuItem ,
7+ DropdownMenuTrigger ,
8+ } from "@/components/ui/dropdown-menu" ;
39import {
410 Plus ,
511 ChevronUp ,
@@ -9,6 +15,8 @@ import {
915 ArrowUp ,
1016 ArrowDown ,
1117 X ,
18+ MoreVertical ,
19+ Eraser ,
1220} from "lucide-react" ;
1321import { tables } from "@runt/schema" ;
1422
@@ -19,6 +27,8 @@ interface CellControlsProps {
1927 onMoveUp : ( ) => void ;
2028 onMoveDown : ( ) => void ;
2129 onDeleteCell : ( ) => void ;
30+ onClearOutputs : ( ) => void ;
31+ hasOutputs : boolean ;
2232 toggleSourceVisibility : ( ) => void ;
2333 toggleAiContextVisibility ?: ( ) => void ;
2434 playButton ?: React . ReactNode ;
@@ -31,6 +41,8 @@ export const CellControls: React.FC<CellControlsProps> = ({
3141 onMoveUp,
3242 onMoveDown,
3343 onDeleteCell,
44+ onClearOutputs,
45+ hasOutputs,
3446 toggleSourceVisibility,
3547 toggleAiContextVisibility,
3648 playButton,
@@ -113,15 +125,28 @@ export const CellControls: React.FC<CellControlsProps> = ({
113125 >
114126 < ArrowDown className = "h-3 w-3" />
115127 </ Button >
116- < Button
117- variant = "ghost"
118- size = "sm"
119- onClick = { onDeleteCell }
120- className = "hover:bg-muted/80 h-7 w-7 p-0 text-red-500 hover:text-red-600"
121- title = "Delete cell"
122- >
123- < X className = "h-3 w-3" />
124- </ Button >
128+ < DropdownMenu >
129+ < DropdownMenuTrigger asChild >
130+ < Button
131+ variant = "ghost"
132+ size = "sm"
133+ className = "hover:bg-muted/80 h-7 w-7 p-0"
134+ title = "More options"
135+ >
136+ < MoreVertical className = "h-3 w-3" />
137+ </ Button >
138+ </ DropdownMenuTrigger >
139+ < DropdownMenuContent align = "end" >
140+ < DropdownMenuItem onClick = { onClearOutputs } disabled = { ! hasOutputs } >
141+ < Eraser className = "mr-2 h-4 w-4" />
142+ < span > Clear outputs</ span >
143+ </ DropdownMenuItem >
144+ < DropdownMenuItem onClick = { onDeleteCell } variant = "destructive" >
145+ < X className = "mr-2 h-4 w-4" />
146+ < span > Delete cell</ span >
147+ </ DropdownMenuItem >
148+ </ DropdownMenuContent >
149+ </ DropdownMenu >
125150 </ div >
126151 </ div >
127152 ) ;
0 commit comments