"use client" import Link from "next/link" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Briefcase, Target, TrendingUp, Users, Calendar, Building2, Lightbulb, BarChart3, Globe, Zap, ArrowRight } from "lucide-react" interface Expertise { title: string skills: string[] } interface Journey { title: string company: string period: string description: string isCurrent: boolean } interface SkillGroup { title: string skills: string[] } interface PortfolioPageProps { page: { title: string content: string frontmatter?: { title?: string summary?: string cta?: string ctaLink?: string profileImage?: string } } } export function PortfolioPage({ page }: PortfolioPageProps) { const frontmatter = page.frontmatter || {} // Parse content sections const sections = parseContentSections(page.content) return (
{/* Hero Section */}
{/* Main Content */}

{frontmatter.title || page.title}

{frontmatter.summary}

{frontmatter.cta && frontmatter.ctaLink && ( )}
{/* Professional Summary */} {sections.professionalSummary && (
)}
{/* Sidebar */}
{/* Profile Image */}
{frontmatter.profileImage ? ( Nhi Vo ) : (
NV
)}
{/* Core Expertise Section */} {sections.coreExpertise && (

Core Expertise

{sections.coreExpertise.map((expertise: Expertise, index: number) => ( {getExpertiseIcon(expertise.title)} {expertise.title}
    {expertise.skills.map((skill: string, skillIndex: number) => (
  • {skill}
  • ))}
))}
)} {/* Professional Journey Timeline */} {sections.professionalJourney && (

Professional Journey

{/* Timeline Line */}
{sections.professionalJourney.map((role: Journey, index: number) => (
{/* Timeline Dot */}
{/* Content */}
{role.title}
{role.company} {role.period}
{role.isCurrent && ( Current )}

{role.description}

))}
)} {/* Skills & Approach */} {sections.skillsApproach && (

Skills & Approach

{sections.skillsApproach.map((skillGroup: SkillGroup, index: number) => ( {getSkillGroupIcon(skillGroup.title)} {skillGroup.title}
{skillGroup.skills.map((skill: string, skillIndex: number) => ( {skill} ))}
))}
)}
) } // Helper function to parse content sections function parseContentSections(content: string) { const sections: any = {} // Parse Professional Summary const summaryMatch = content.match(/# Professional Summary\n\n([\s\S]*?)(?=\n## |$)/) if (summaryMatch) { sections.professionalSummary = summaryMatch[1] } // Parse Core Expertise const expertiseMatch = content.match(/## Core Expertise\n\n([\s\S]*?)(?=\n## |$)/) if (expertiseMatch) { sections.coreExpertise = parseExpertise(expertiseMatch[1]) } // Parse Professional Journey const journeyMatch = content.match(/## Professional Journey\n\n([\s\S]*?)(?=\n## |$)/) if (journeyMatch) { sections.professionalJourney = parseJourney(journeyMatch[1]) } // Parse Skills & Approach const skillsMatch = content.match(/## Skills & Approach\n\n([\s\S]*?)(?=\n## |$)/) if (skillsMatch) { sections.skillsApproach = parseSkills(skillsMatch[1]) } return sections } function parseExpertise(content: string) { const expertise: any[] = [] const sections = content.split(/\n### /) sections.slice(1).forEach(section => { const lines = section.split('\n') const title = lines[0] const skills = lines.slice(1) .filter(line => line.trim().startsWith('-')) .map(line => line.trim().substring(1).trim()) if (title && skills.length > 0) { expertise.push({ title, skills }) } }) return expertise } function parseJourney(content: string) { const journey: any[] = [] const sections = content.split(/\n### /) sections.slice(1).forEach(section => { const lines = section.split('\n') const title = lines[0] const companyPeriod = lines[1]?.match(/\*\*(.*?)\*\*/)?.[1] || '' const description = lines.slice(2).join('\n').trim() const [company, period] = companyPeriod.split(' | ') const isCurrent = period?.includes('Present') if (title && company && period) { journey.push({ title, company, period, description, isCurrent }) } }) return journey } function parseSkills(content: string) { const skills: any[] = [] const sections = content.split(/\n### /) sections.slice(1).forEach(section => { const lines = section.split('\n') const title = lines[0] const skillsList = lines.slice(1) .filter(line => line.trim().startsWith('-')) .map(line => line.trim().substring(1).trim()) if (title && skillsList.length > 0) { skills.push({ title, skills: skillsList }) } }) return skills } function getExpertiseIcon(title: string) { switch (title.toLowerCase()) { case 'business strategy & analysis': return case 'commercial excellence': return case 'digital transformation': return default: return } } function getSkillGroupIcon(title: string) { switch (title.toLowerCase()) { case 'technical capabilities': return case 'industry focus': return default: return } }