import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { Archive, ArchiveRestore, MoreVertical, Palette, Pin, Trash2, Users, Maximize2, } from "lucide-react" import { cn } from "@/lib/utils" import { NOTE_COLORS } from "@/lib/types" interface NoteActionsProps { isPinned: boolean isArchived: boolean currentColor: string currentSize?: 'small' | 'medium' | 'large' onTogglePin: () => void onToggleArchive: () => void onColorChange: (color: string) => void onSizeChange?: (size: 'small' | 'medium' | 'large') => void onDelete: () => void onShareCollaborators?: () => void className?: string } export function NoteActions({ isPinned, isArchived, currentColor, currentSize = 'small', onTogglePin, onToggleArchive, onColorChange, onSizeChange, onDelete, onShareCollaborators, className }: NoteActionsProps) { return (
e.stopPropagation()} > {/* Color Palette */}
{Object.entries(NOTE_COLORS).map(([colorName, classes]) => (
{/* More Options */} {isArchived ? ( <> Unarchive ) : ( <> Archive )} {/* Size Selector */} {onSizeChange && ( <>
Size
{(['small', 'medium', 'large'] as const).map((size) => ( onSizeChange(size)} className={cn( "capitalize", currentSize === size && "bg-accent" )} > {size} ))} )} {/* Collaborators */} {onShareCollaborators && ( <> { e.stopPropagation() onShareCollaborators() }} > Share with collaborators )} Delete
) }