mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
support multi languages
This commit is contained in:
1 parent
ca8ff2f983
commit
72a832c781
24 files changed
+995
-175
No files matched your search
@@ -2,26 +2,21 @@ import { useParams, Link } from 'react-router'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
const categoryLabels: Record<string, string> = {
|
||||
'software-engineering': 'Software Engineering',
|
||||
logistics: 'Logistics',
|
||||
'ai-ml': 'AI / ML',
|
||||
'computer-vision': 'Computer Vision',
|
||||
architecture: 'Architecture',
|
||||
experiment: 'Experiment',
|
||||
}
|
||||
|
||||
export function ProjectDetailPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const { lang } = useLanguage()
|
||||
const project = projects.find((p) => p.id === id)
|
||||
|
||||
if (!project) {
|
||||
return (
|
||||
<section className="section container-content">
|
||||
<h2>Project Not Found</h2>
|
||||
<h2>{strings.projectDetail.notFound[lang]}</h2>
|
||||
<p>
|
||||
<Link to="/projects">← Back to Projects</Link>
|
||||
<Link to="/projects">{strings.projectDetail.backToProjects[lang]} ←</Link>
|
||||
</p>
|
||||
</section>
|
||||
)
|
||||
@@ -30,21 +25,21 @@ export function ProjectDetailPage() {
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="project-title">
|
||||
<Link to="/projects" style={{ fontSize: '14px', fontWeight: 500, color: 'var(--accent)', marginBottom: '32px', display: 'inline-block' }}>
|
||||
← Back to Projects
|
||||
{strings.projectDetail.backToProjects[lang]} ←
|
||||
</Link>
|
||||
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '16px', marginBottom: '16px' }}>
|
||||
<h1 id="project-title" style={{ flex: 1 }}>{project.title}</h1>
|
||||
<Badge variant="outline">{categoryLabels[project.category] || project.category}</Badge>
|
||||
<Badge variant="outline">{strings.projects.categories[project.category][lang]}</Badge>
|
||||
</div>
|
||||
|
||||
<p style={{ fontSize: '18px', color: 'var(--text-secondary)', marginBottom: '32px' }}>
|
||||
{project.summary}
|
||||
{lang === 'vi' ? project.summary : project.summaryEn}
|
||||
</p>
|
||||
|
||||
{project.metrics && project.metrics.length > 0 && (
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Impact</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.impact[lang]}</h3>
|
||||
<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
|
||||
{project.metrics.map((m) => (
|
||||
<span key={m} className="achievement-metric">
|
||||
@@ -56,12 +51,12 @@ export function ProjectDetailPage() {
|
||||
)}
|
||||
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Role</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.role[lang]}</h3>
|
||||
<p>{project.role}</p>
|
||||
</div>
|
||||
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Technologies</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.technologies[lang]}</h3>
|
||||
<div className="philosophy-keywords">
|
||||
{project.technologies.map((tech) => (
|
||||
<Tag key={tech}>{tech}</Tag>
|
||||
@@ -71,11 +66,11 @@ export function ProjectDetailPage() {
|
||||
|
||||
{project.sections && project.sections.length > 0 && (
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Engineering Experiments</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.experiments[lang]}</h3>
|
||||
{project.sections.map((section, idx) => (
|
||||
<div key={idx} style={{ marginBottom: '16px', padding: '16px', background: 'var(--bg-surface)', borderRadius: '8px' }}>
|
||||
<h4 style={{ fontSize: '14px', marginBottom: '4px', color: 'var(--text-primary)' }}>{section.title}</h4>
|
||||
<p style={{ fontSize: '14px', color: 'var(--text-secondary)' }}>{section.content}</p>
|
||||
<h4 style={{ fontSize: '14px', marginBottom: '4px', color: 'var(--text-primary)' }}>{lang === 'vi' ? section.title : section.titleEn}</h4>
|
||||
<p style={{ fontSize: '14px', color: 'var(--text-secondary)' }}>{lang === 'vi' ? section.content : section.contentEn}</p>
|
||||
<Tag accent>{section.type}</Tag>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user