import React from 'react'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import { ArrowLeft, Share2, Play, Calendar, User, Building2 } from 'lucide-react'; import { prisma } from '../../../lib/prisma'; import { InterviewType } from '@prisma/client'; interface Props { params: Promise<{ id: string }>; } export default async function InterviewDetailPage({ params }: Props) { const { id } = await params; const interview = await prisma.interview.findUnique({ where: { id } }); if (!interview) { notFound(); } // Helper to get YouTube embed URL const getEmbedUrl = (url: string) => { const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/; const match = url.match(regExp); return (match && match[2].length === 11) ? `https://www.youtube.com/embed/${match[2]}` : null; }; const isVideo = interview.type === InterviewType.VIDEO; return (
Retour à Afro Life {/* Header Info */}
{isVideo ? 'Interview Vidéo' : 'Grand Entretien'}

{interview.title}

{interview.guestName} | {interview.role}
{interview.companyName}
{new Date(interview.date).toLocaleDateString('fr-FR', { day: 'numeric', month: 'long', year: 'numeric' })}
{/* Main Content Area */} {isVideo ? (
{interview.videoUrl ? ( ) : (

Vidéo non disponible

)}
) : (
{interview.title}
)} {/* Description / Article Content */}
{!isVideo && interview.content ? (
) : (

{interview.excerpt}

)}
{/* Footer Actions */}
); }