feat: add certificate gallery and certifications section components

- Implemented CertificateGallery component to display certification images in a gallery format.
- Created CertificationsSection component to showcase certifications with titles and descriptions.
- Enhanced Gallery component to support animations and keyboard navigation.
- Introduced Select component for dropdown selection with images.
- Added utility functions for API responses and pagination handling.
- Implemented localization functions for text and content.
- Created a custom hook for detecting clicks outside of a component.
This commit is contained in:
2026-07-19 07:59:16 +03:30
parent 478b550c51
commit 730e2d8ca8
60 changed files with 1859 additions and 1403 deletions
+19 -18
View File
@@ -1,28 +1,29 @@
import { NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { projects } from '../data';
import { getLocaleFromCookies } from '@/lib/locale';
import { localizeContent, localizeText } from '@/lib/domain';
import { notFound, ok } from '@/lib/api-response';
export async function GET(request: Request, context: any) {
const params = await context.params;
const projectId = params.id;
type RouteContext = {
params: {
id: string;
};
};
const cookieStore = await cookies();
const lang = cookieStore.get('locale')?.value || 'en';
export async function GET(request: Request, context: RouteContext) {
const projectId = context.params.id;
const locale = await getLocaleFromCookies();
let project = projects.find((project) => project.id === projectId);
if (!project) {
return NextResponse.json({ error: 'Not found' }, { status: 404 });
return notFound();
}
if (lang === 'fa') {
project = {
...project,
title: project.fa_title || project.title,
content: project.fa_content || project.content,
};
}
project = {
...project,
title: localizeText(locale, project.title, project.fa_title),
content: localizeContent(locale, project.content, project.fa_content),
};
return NextResponse.json({
data: project,
});
return ok(project);
}