import React, { useEffect } from 'react'; import { useParams, Link } from 'react-router-dom'; import { ArrowLeft, Share2, Play, Calendar, User, Building2 } from 'lucide-react'; import { MOCK_INTERVIEWS } from '../services/mockData'; import { InterviewType } from '../types'; const InterviewDetailPage = () => { const { id } = useParams(); const interview = MOCK_INTERVIEWS.find(i => i.id === id); useEffect(() => { window.scrollTo(0, 0); }, [id]); if (!interview) return null; // 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}
{interview.date}
{/* Main Content Area */} {isVideo ? (
{interview.videoUrl ? ( ) : (

Vidéo non disponible

)}
) : (
{interview.title}
)} {/* Description / Article Content */}
{!isVideo && interview.content ? ( interview.content.split('\n').map((paragraph, idx) => (

{paragraph}

)) ) : (

{interview.excerpt}

)}
{/* Footer Actions */}
); }; export default InterviewDetailPage;