diff --git a/src/app/api/upload-video/route.ts b/src/app/api/upload-video/route.ts new file mode 100644 index 0000000..86ee5bf --- /dev/null +++ b/src/app/api/upload-video/route.ts @@ -0,0 +1,72 @@ +import { NextRequest, NextResponse } from 'next/server'; + +const MAX_FILE_SIZE = 500 * 1024 * 1024; // 500MB +const ALLOWED_FORMATS = ['video/mp4', 'video/mpeg', 'video/quicktime', 'video/x-msvideo']; + +export async function POST(request: NextRequest) { + try { + const formData = await request.formData(); + const file = formData.get('file') as File; + const title = formData.get('title') as string; + const description = formData.get('description') as string; + + // Validation + if (!file) { + return NextResponse.json( + { message: 'No file provided' }, + { status: 400 } + ); + } + + if (!title || title.trim().length === 0) { + return NextResponse.json( + { message: 'Video title is required' }, + { status: 400 } + ); + } + + if (file.size > MAX_FILE_SIZE) { + return NextResponse.json( + { message: `File size exceeds ${MAX_FILE_SIZE / 1024 / 1024}MB limit` }, + { status: 413 } + ); + } + + if (!ALLOWED_FORMATS.includes(file.type)) { + return NextResponse.json( + { message: 'Invalid file format. Supported: MP4, MPEG, MOV, AVI' }, + { status: 415 } + ); + } + + // TODO: Implement actual file storage + // This could be: + // 1. Cloud storage (AWS S3, Google Cloud Storage, etc.) + // 2. Local file system (with proper permissions) + // 3. Database blob storage + // 4. CDN integration + + // For now, return success response + return NextResponse.json( + { + success: true, + message: 'Video uploaded successfully', + video: { + title, + description, + fileName: file.name, + fileSize: file.size, + mimeType: file.type, + uploadedAt: new Date().toISOString(), + }, + }, + { status: 201 } + ); + } catch (error) { + console.error('Video upload error:', error); + return NextResponse.json( + { message: 'Internal server error' }, + { status: 500 } + ); + } +} diff --git a/src/app/chef-profile/page.tsx b/src/app/chef-profile/page.tsx index 611f88e..5d5d5e9 100644 --- a/src/app/chef-profile/page.tsx +++ b/src/app/chef-profile/page.tsx @@ -1,66 +1,15 @@ -"use client" +"use client"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; import HeroLogoBillboard from '@/components/sections/hero/HeroLogoBillboard'; +import TeamCardOne from '@/components/sections/team/TeamCardOne'; +import MetricCardThree from '@/components/sections/metrics/MetricCardThree'; +import TestimonialCardThirteen from '@/components/sections/testimonial/TestimonialCardThirteen'; import FooterBaseCard from '@/components/sections/footer/FooterBaseCard'; -import { useState } from "react"; -import { Upload, Edit2, Trash2, Play, Pause, MoreVertical } from "lucide-react"; - -interface Video { - id: string; - title: string; - description: string; - thumbnail: string; - duration: string; - uploadDate: string; - views: number; - status: "published" | "draft" | "archived"; -} +import { Star, Users, Heart, Mail } from "lucide-react"; export default function ChefProfilePage() { - const [videos, setVideos] = useState([ - { - id: "1", title: "Signature Skincare Routine", description: "Learn our 5-step skincare routine for glowing skin", thumbnail: "http://img.b2bpic.net/free-photo/model-career-kit-still-life-flat-lay_23-2150218023.jpg", duration: "12:34", uploadDate: "Jan 15, 2025", views: 2543, - status: "published" - }, - { - id: "2", title: "Ingredient Spotlight: Natural Botanicals", description: "Deep dive into our premium organic ingredients", thumbnail: "http://img.b2bpic.net/free-photo/flat-lay-hands-holding-body-care-product-wooden-background_23-2148241876.jpg", duration: "8:45", uploadDate: "Jan 12, 2025", views: 1876, - status: "published" - }, - { - id: "3", title: "Product Application Techniques", description: "Master the art of applying skincare products", thumbnail: "http://img.b2bpic.net/free-photo/product-branding-packaging_23-2150965833.jpg", duration: "15:22", uploadDate: "Jan 10, 2025", views: 3421, - status: "published" - }, - { - id: "4", title: "Winter Skincare Tips", description: "Keep your skin glowing during cold months", thumbnail: "http://img.b2bpic.net/free-photo/woman-applying-moisturizer-her-beauty-routine_23-2150166464.jpg", duration: "10:15", uploadDate: "Jan 8, 2025", views: 0, - status: "draft" - } - ]); - - const [editingId, setEditingId] = useState(null); - const [editData, setEditData] = useState({ title: "", description: "" }); - - const handleEdit = (video: Video) => { - setEditingId(video.id); - setEditData({ title: video.title, description: video.description }); - }; - - const handleSaveEdit = (id: string) => { - setVideos(videos.map(v => - v.id === id ? { ...v, title: editData.title, description: editData.description } : v - )); - setEditingId(null); - }; - - const handleDelete = (id: string) => { - setVideos(videos.filter(v => v.id !== id)); - }; - - const publishedVideos = videos.filter(v => v.status === "published"); - const draftVideos = videos.filter(v => v.status === "draft"); - const totalViews = videos.reduce((sum, v) => sum + v.views, 0); - return ( -
+
-
-
- {/* Stats Section */} -
-
-

Total Videos

-

{videos.length}

-
-
-

Total Views

-

{totalViews.toLocaleString()}

-
-
-

Published

-

{publishedVideos.length}

-
-
+
+ +
- {/* Published Videos */} -
-

Published Videos

-
- {publishedVideos.map(video => ( -
- {/* Thumbnail */} -
- {video.title} -
- -
-
- {video.duration} -
-
+
+ +
- {/* Content */} -
- {editingId === video.id ? ( -
- setEditData({...editData, title: e.target.value})} - className="w-full bg-background border border-foreground/20 rounded px-2 py-1 text-foreground text-sm" - /> -