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 (
Vidéo non disponible
{interview.excerpt}
)}