diff --git a/app/(dashboard)/projects/[projectId]/project-content-client.tsx b/app/(dashboard)/projects/[projectId]/project-content-client.tsx index 5826afe..b992420 100644 --- a/app/(dashboard)/projects/[projectId]/project-content-client.tsx +++ b/app/(dashboard)/projects/[projectId]/project-content-client.tsx @@ -19,6 +19,7 @@ import { Loader2, Trash2, ChevronDown, + FolderInput, } from 'lucide-react'; import { toast } from 'sonner'; import { Button } from '@/components/ui/button'; @@ -42,6 +43,7 @@ import { } from '@/components/ui/alert-dialog'; import { VideoCard } from '@/components/video-card'; import { VideoDragDropUploader } from '@/components/video-drag-drop-uploader'; +import { MoveVideosDialog } from '@/components/move-videos-dialog'; import type { DirectUploadProvider } from '@/components/video-page/types'; import { runProjectDownloadManifest, @@ -105,6 +107,7 @@ export function ProjectContentClient({ const [isDownloading, setIsDownloading] = useState(false); const [isDeletingSelected, setIsDeletingSelected] = useState(false); const [showDeleteSelectedDialog, setShowDeleteSelectedDialog] = useState(false); + const [showMoveSelectedDialog, setShowMoveSelectedDialog] = useState(false); const canSelectVideos = canDownloadProject || canEdit; @@ -138,6 +141,13 @@ export function ProjectContentClient({ setSelectedVideoIds((prev) => prev.filter((id) => id !== videoId)); }, []); + const handleVideosMoved = useCallback((movedIds: string[]) => { + const moved = new Set(movedIds); + setLocalVideos((prev) => prev.filter((video) => !moved.has(video.id))); + setSelectedVideoIds([]); + setSelectionMode(false); + }, []); + const toggleVideoSelection = useCallback((videoId: string, selected: boolean) => { setSelectedVideoIds((prev) => { if (selected) { @@ -447,6 +457,17 @@ export function ProjectContentClient({ )} + {canEdit && ( + + )} {canEdit && ( + + + + + ); +} diff --git a/components/video-card.tsx b/components/video-card.tsx index c163498..a82e971 100644 --- a/components/video-card.tsx +++ b/components/video-card.tsx @@ -18,6 +18,7 @@ import { Trash2, CheckSquare, Check, + FolderInput, } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; @@ -55,6 +56,7 @@ import { type VideoSource, } from '@/lib/video-providers'; import { resolvePublicBunnyCdnHostname } from '@/lib/bunny-cdn'; +import { MoveVideosDialog } from '@/components/move-videos-dialog'; import { cn } from '@/lib/utils'; interface VideoCardProps { @@ -110,6 +112,9 @@ export function VideoCard({ // Delete dialog const [showDeleteDialog, setShowDeleteDialog] = useState(false); const [isDeleting, setIsDeleting] = useState(false); + + // Move dialog + const [showMoveDialog, setShowMoveDialog] = useState(false); const bunnyCdnHostname = useMemo(() => resolvePublicBunnyCdnHostname(), []); const resolvedThumbnailUrl = useMemo(() => { if (!video.thumbnailUrl) return ''; @@ -409,6 +414,10 @@ export function VideoCard({ Add Version + setShowMoveDialog(true)}> + + Move to project + setShowDeleteDialog(true)} @@ -576,6 +585,15 @@ export function VideoCard({ + + {/* Move to another project */} + onDeleted?.(video.id)} + /> ); }