import { FileText, Plus, SquareCode } from 'lucide-react' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from 'ui' import { createMarkdownCellSkeleton, createQueryCellSkeleton } from './utils' import { ButtonTooltip } from '@/components/ui/ButtonTooltip' import { useCurrentNotebook, useNotebooksStateSnapshot } from '@/state/notebooks/notebooks-state' interface AddCellDropdownProps { cellId: string } export const AddCellDropdown = ({ cellId }: AddCellDropdownProps) => { const snap = useNotebooksStateSnapshot() const currentNotebook = useCurrentNotebook() const onSelectAddCell = (type: 'markdown' | 'query') => { const notebookId = currentNotebook?.notebook.id if (!notebookId) return const cell = type === 'markdown' ? createMarkdownCellSkeleton() : createQueryCellSkeleton() snap.insertCellAfter({ id: notebookId, cellId, cell }) } return ( } tooltip={{ content: { side: 'bottom', text: 'Add cell' } }} /> onSelectAddCell('query')}> Add query cell onSelectAddCell('markdown')}> Add markdown cell ) }