diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index 319ca13..a0a0d31 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -7,6 +7,18 @@ const nextConfig: NextConfig = { reactStrictMode: true, productionBrowserSourceMaps: true, output: "standalone", + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "plus.unsplash.com", + }, + { + protocol: "https", + hostname: "images.unsplash.com", + }, + ], + }, }; export default nextConfig; diff --git a/apps/web/src/app/projects/page.tsx b/apps/web/src/app/projects/page.tsx new file mode 100644 index 0000000..ad1c0c0 --- /dev/null +++ b/apps/web/src/app/projects/page.tsx @@ -0,0 +1,210 @@ +"use client"; + +import Link from "next/link"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { + ChevronLeft, + Plus, + Calendar, + MoreHorizontal, + Video, +} from "lucide-react"; +import { TProject } from "@/types/project"; +import Image from "next/image"; +import { + DropdownMenu, + DropdownMenuItem, + DropdownMenuContent, + DropdownMenuTrigger, + DropdownMenuSeparator, +} from "@/components/ui/dropdown-menu"; + +// Hard-coded project data +const mockProjects: TProject[] = [ + { + id: "1", + name: "Summer Vacation Highlights", + createdAt: new Date("2024-12-15"), + updatedAt: new Date("2024-12-20"), + thumbnail: + "https://plus.unsplash.com/premium_photo-1750854354243-81f40af63a73?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + }, + { + id: "2", + name: "Product Demo Video", + createdAt: new Date("2024-12-10"), + updatedAt: new Date("2024-12-18"), + thumbnail: + "https://images.unsplash.com/photo-1750875936215-0c35c1742cd6?q=80&w=688&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + }, + { + id: "3", + name: "Wedding Ceremony Edit", + createdAt: new Date("2024-12-05"), + updatedAt: new Date("2024-12-16"), + thumbnail: + "https://images.unsplash.com/photo-1750967991618-7b64a3025381?q=80&w=687&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + }, + { + id: "4", + name: "Travel Vlog - Japan", + createdAt: new Date("2024-11-28"), + updatedAt: new Date("2024-12-14"), + thumbnail: + "https://images.unsplash.com/photo-1750639258774-9a714379a093?q=80&w=1470&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", + }, +]; + +// Mock duration data (in seconds) +const mockDurations: Record = { + "1": 245, // 4:05 + "2": 120, // 2:00 + "3": 1800, // 30:00 + "4": 780, // 13:00 + "5": 360, // 6:00 + "6": 180, // 3:00 +}; + +export default function ProjectsPage() { + return ( +
+
+ + + Back + +
+ +
+
+
+
+
+

+ Your Projects +

+

+ {mockProjects.length}{" "} + {mockProjects.length === 1 ? "project" : "projects"} +

+
+
+ +
+
+ + {mockProjects.length === 0 ? ( +
+
+
+

No projects yet

+

+ Start creating your first video project. Import media, edit, and + export professional videos. +

+ + + +
+ ) : ( +
+ {mockProjects.map((project, index) => ( + + ))} +
+ )} +
+
+ ); +} + +function ProjectCard({ project }: { project: TProject }) { + const formatDuration = (seconds: number): string => { + const minutes = Math.floor(seconds / 60); + const remainingSeconds = Math.floor(seconds % 60); + return `${minutes}:${remainingSeconds.toString().padStart(2, "0")}`; + }; + + const formatDate = (date: Date): string => { + return date.toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + }); + }; + + return ( + + +
+ {/* Thumbnail preview */} +
+ Project thumbnail +
+ + {/* Duration badge */} +
+ {formatDuration(mockDurations[project.id] || 0)} +
+
+ + +
+

+ {project.name} +

+ + + + + + Rename + Duplicate + + + Delete + + + +
+ +
+
+ + Created {formatDate(project.createdAt)} +
+
+
+
+ + ); +} + +function CreateButton() { + return ( + + ); +} diff --git a/apps/web/src/stores/project-store.ts b/apps/web/src/stores/project-store.ts index 0d0812c..43113fc 100644 --- a/apps/web/src/stores/project-store.ts +++ b/apps/web/src/stores/project-store.ts @@ -17,6 +17,7 @@ export const useProjectStore = create((set) => ({ const newProject: TProject = { id: crypto.randomUUID(), name, + thumbnail: "", createdAt: new Date(), updatedAt: new Date(), }; diff --git a/apps/web/src/types/project.ts b/apps/web/src/types/project.ts index 74886b2..8b1eff3 100644 --- a/apps/web/src/types/project.ts +++ b/apps/web/src/types/project.ts @@ -1,6 +1,7 @@ export interface TProject { id: string; name: string; + thumbnail: string; createdAt: Date; updatedAt: Date; } diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts index 00309f8..7a094df 100644 --- a/apps/web/tailwind.config.ts +++ b/apps/web/tailwind.config.ts @@ -8,6 +8,9 @@ export default { ], theme: { extend: { + screens: { + xs: "480px", + }, fontSize: { base: "0.95rem", },