diff --git a/src/app/[locale]/(dashboard)/dashboard/projects/[id]/page.tsx b/src/app/[locale]/(dashboard)/dashboard/projects/[id]/page.tsx index bf2f07f..0de4ecd 100644 --- a/src/app/[locale]/(dashboard)/dashboard/projects/[id]/page.tsx +++ b/src/app/[locale]/(dashboard)/dashboard/projects/[id]/page.tsx @@ -33,6 +33,7 @@ import { SceneCard } from '@/components/project/scene-card'; import { RenderProgress } from '@/components/project/render-progress'; import { VideoPlayer } from '@/components/project/video-player'; import { projectsApi } from '@/lib/api/api-service'; +import { CINEMATIC_REFERENCES } from '@/constants/cinematic-references'; // X (Twitter) ikonunu burada da tanımlıyoruz const XIcon = ({ size = 16 }: { size?: number }) => ( @@ -255,8 +256,18 @@ export default function ProjectDetailPage() { try { await projectsApi.update(id, { videoStyle: newStyleId } as any); refetch(); - } catch (err) { - console.error('Üslup (Stil) değiştirme hatası:', err); + } catch (error) { + console.error('Failed to update style:', error); + } + }; + + const handleCinematicReferenceChange = async (newRef: string) => { + if (newRef === project.cinematicReference) return; + try { + await projectsApi.update(id, { cinematicReference: newRef || undefined } as any); + refetch(); + } catch (error) { + console.error('Failed to update cinematic reference:', error); } }; @@ -354,6 +365,24 @@ export default function ProjectDetailPage() { ) : ( {currentStyle ? `${currentStyle.emoji} ${currentStyle.label}` : project.videoStyle} )} + + {project.videoStyle === 'CINEMATIC' && isEditable ? ( + + ) : project.videoStyle === 'CINEMATIC' && project.cinematicReference ? ( + + 🎬 {project.cinematicReference} + + ) : null} + {project.language} {new Date(project.createdAt).toLocaleDateString('tr-TR', { @@ -485,7 +514,11 @@ export default function ProjectDetailPage() { isEditable={isEditable} onUpdate={handleSceneUpdate} onRegenerate={handleSceneRegenerate} + onGenerateImage={handleGenerateImage} + onUpscaleImage={handleUpscaleImage} isRegenerating={regeneratingSceneId === scene.id} + isGeneratingImage={generatingImageId === scene.id} + isUpscalingImage={upscalingImageId === scene.id} /> ))} diff --git a/src/app/[locale]/(dashboard)/dashboard/projects/page.tsx b/src/app/[locale]/(dashboard)/dashboard/projects/page.tsx index 7d257b2..6cd8512 100644 --- a/src/app/[locale]/(dashboard)/dashboard/projects/page.tsx +++ b/src/app/[locale]/(dashboard)/dashboard/projects/page.tsx @@ -12,10 +12,11 @@ import { AlertCircle, ExternalLink, Loader2, + Trash2, } from "lucide-react"; import Link from "next/link"; import { cn } from "@/lib/utils"; -import { useProjects } from "@/hooks/use-api"; +import { useProjects, useDeleteProject } from "@/hooks/use-api"; const statusFilters = [ { id: "all", label: "Tümü" }, @@ -84,6 +85,15 @@ export default function ProjectsPage() { const [searchQuery, setSearchQuery] = useState(""); const { data, isLoading } = useProjects({ limit: 100 }); + const deleteMutation = useDeleteProject(); + + const handleDelete = (e: React.MouseEvent, id: string) => { + e.preventDefault(); + e.stopPropagation(); + if (confirm("Bu projeyi silmek istediğinize emin misiniz?")) { + deleteMutation.mutate(id); + } + }; // useProjects returns PaginatedResponse which has .data as Project[] // eslint-disable-next-line @typescript-eslint/no-explicit-any const raw = data as any; @@ -243,10 +253,20 @@ export default function ProjectsPage() { {st.label} + + + +