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" import { useLanguage } from "@/lib/i18n" 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) { const { t } = useLanguage() return (
e.stopPropagation()} > {/* Color Palette */}
{Object.entries(NOTE_COLORS).map(([colorName, classes]) => (
{/* More Options */} {isArchived ? ( <> {t('notes.unarchive')} ) : ( <> {t('notes.archive')} )} {/* Size Selector */} {onSizeChange && ( <>
{t('notes.size')}
{(['small', 'medium', 'large'] as const).map((size) => ( onSizeChange(size)} className={cn( "capitalize", currentSize === size && "bg-accent" )} > {t(`notes.${size}` as const)} ))} )} {/* Collaborators */} {onShareCollaborators && ( <> { e.stopPropagation() onShareCollaborators() }} > {t('notes.shareWithCollaborators')} )} {t('notes.delete')}
) }