feat: add 'new sub-notebook' option in note move dropdown
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
|||||||
DropdownMenuSub,
|
DropdownMenuSub,
|
||||||
DropdownMenuSubContent,
|
DropdownMenuSubContent,
|
||||||
DropdownMenuSubTrigger,
|
DropdownMenuSubTrigger,
|
||||||
|
DropdownMenuSeparator,
|
||||||
} from '@/components/ui/dropdown-menu'
|
} from '@/components/ui/dropdown-menu'
|
||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
@@ -23,7 +24,7 @@ import {
|
|||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
AlertDialogTitle,
|
AlertDialogTitle,
|
||||||
} from '@/components/ui/alert-dialog'
|
} from '@/components/ui/alert-dialog'
|
||||||
import { Pin, Bell, GripVertical, X, Link2, FolderOpen, StickyNote, LucideIcon, Folder, Briefcase, FileText, Zap, BarChart3, Globe, Sparkles, Book, Heart, Crown, Music, Building2, LogOut, Trash2, AlignLeft, FileCode2, PenLine, ListChecks, ChevronRight } from 'lucide-react'
|
import { Pin, Bell, GripVertical, X, Link2, FolderOpen, StickyNote, LucideIcon, Folder, Briefcase, FileText, Zap, BarChart3, Globe, Sparkles, Book, Heart, Crown, Music, Building2, LogOut, Trash2, AlignLeft, FileCode2, PenLine, ListChecks, ChevronRight, Plus } from 'lucide-react'
|
||||||
import { useState, useEffect, useTransition, useOptimistic, memo, useMemo } from 'react'
|
import { useState, useEffect, useTransition, useOptimistic, memo, useMemo } from 'react'
|
||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
import { useSession } from 'next-auth/react'
|
import { useSession } from 'next-auth/react'
|
||||||
@@ -118,7 +119,7 @@ function getNotebookIcon(iconName: string): LucideIcon {
|
|||||||
return IconComponent
|
return IconComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NoteCardProps {
|
interface NoteCardProps {
|
||||||
note: Note
|
note: Note
|
||||||
onEdit?: (note: Note, readOnly?: boolean) => void
|
onEdit?: (note: Note, readOnly?: boolean) => void
|
||||||
isDragging?: boolean
|
isDragging?: boolean
|
||||||
@@ -130,6 +131,7 @@ interface NoteCardProps {
|
|||||||
isTrashView?: boolean
|
isTrashView?: boolean
|
||||||
noteHistoryEnabled?: boolean
|
noteHistoryEnabled?: boolean
|
||||||
onOpenHistory?: (note: Note) => void
|
onOpenHistory?: (note: Note) => void
|
||||||
|
onCreateSubNotebook?: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper function to get initials from name
|
// Helper function to get initials from name
|
||||||
@@ -171,6 +173,7 @@ export const NoteCard = memo(function NoteCard({
|
|||||||
isTrashView,
|
isTrashView,
|
||||||
noteHistoryEnabled = false,
|
noteHistoryEnabled = false,
|
||||||
onOpenHistory,
|
onOpenHistory,
|
||||||
|
onCreateSubNotebook,
|
||||||
}: NoteCardProps) {
|
}: NoteCardProps) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
@@ -543,6 +546,11 @@ export const NoteCard = memo(function NoteCard({
|
|||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
<DropdownMenuSeparator />
|
||||||
|
<DropdownMenuItem className="text-muted-foreground" onSelect={() => onCreateSubNotebook?.()}>
|
||||||
|
<Plus className="h-4 w-4 mr-2" />
|
||||||
|
{t('notebook.createSubNotebook') || 'Nouveau sous-carnet…'}
|
||||||
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</div>}
|
</div>}
|
||||||
|
|||||||
Reference in New Issue
Block a user