first commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { getDemoBySlug, demos } from "@/data/demos";
|
||||
import KlinikTemplate from "@/components/templates/KlinikTemplate";
|
||||
import RestoranTemplate from "@/components/templates/RestoranTemplate";
|
||||
import KurumsalTemplate from "@/components/templates/KurumsalTemplate";
|
||||
import DentalTemplate from "@/components/templates/DentalTemplate";
|
||||
import RestoranTemplate2 from "@/components/templates/RestoranTemplate2";
|
||||
import { notFound } from "next/navigation";
|
||||
import { i18n, Locale } from "@/i18n-config";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const paths: Array<{ lang: Locale; slug: string }> = [];
|
||||
const demoList = Object.keys(demos);
|
||||
for (const lang of i18n.locales) {
|
||||
for (const slug of demoList) {
|
||||
paths.push({ lang, slug });
|
||||
}
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale; slug: string }> }) {
|
||||
const { slug } = await params;
|
||||
const data = getDemoBySlug(slug);
|
||||
if (!data) return { title: "Demo Bulunamadı | Ayris Tech" };
|
||||
return {
|
||||
title: `${data.firma.adi} — Premium Arayüz Demosu`,
|
||||
description: data.firma.slogan,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function DemoPage({ params }: { params: Promise<{ lang: Locale; slug: string }> }) {
|
||||
const { slug } = await params;
|
||||
const data = getDemoBySlug(slug);
|
||||
if (!data) notFound();
|
||||
|
||||
if (data.template === "klinik") return <KlinikTemplate data={data} />;
|
||||
if (data.template === "restoran") return <RestoranTemplate data={data} />;
|
||||
if (data.template === "kurumsal") return <KurumsalTemplate data={data} />;
|
||||
if (data.template === "dental") return <DentalTemplate data={data} />;
|
||||
if (data.template === "restoran2") return <RestoranTemplate2 data={data} />;
|
||||
notFound();
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { adminLoginAction } from "@/app/actions";
|
||||
import Link from "next/link";
|
||||
|
||||
const expo = [0.16, 1, 0.3, 1] as [number, number, number, number];
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ lang: string }>;
|
||||
}
|
||||
|
||||
export default function AdminLoginPage({ params }: Props) {
|
||||
const router = useRouter();
|
||||
|
||||
// Unpack params Promise natively using React 19 use() hook
|
||||
const { lang } = React.use(params);
|
||||
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!username.trim() || !password.trim()) {
|
||||
setError("Kullanıcı adı ve şifre zorunludur!");
|
||||
return;
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
const res = await adminLoginAction({ username: username.trim(), password: password.trim() });
|
||||
if (res.success) {
|
||||
router.push(`/${lang}/admin`);
|
||||
} else {
|
||||
setError(res.error || "Giriş başarısız!");
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-[#F4F0E8] text-[#0A0A0A] font-body min-h-screen flex items-center justify-center p-6 relative overflow-hidden">
|
||||
{/* Dynamic Background Pattern */}
|
||||
<div
|
||||
className="absolute inset-0 opacity-[0.03] pointer-events-none select-none"
|
||||
style={{
|
||||
backgroundImage: "radial-gradient(#000 1px, transparent 1px)",
|
||||
backgroundSize: "20px 20px"
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Decorative Floating Block */}
|
||||
<div className="absolute top-1/4 left-1/4 w-32 h-32 bg-[#FFE600] opacity-10 blur-2xl rounded-full pointer-events-none" />
|
||||
<div className="absolute bottom-1/4 right-1/4 w-48 h-48 bg-[#FF4500] opacity-5 blur-3xl rounded-full pointer-events-none" />
|
||||
|
||||
<main className="relative z-10 w-full max-w-md">
|
||||
{/* Back to Home Link */}
|
||||
<div className="mb-6 flex justify-start">
|
||||
<Link
|
||||
href={`/${lang}`}
|
||||
className="inline-flex items-center gap-2 font-mono text-[10px] tracking-[0.25em] uppercase text-[#A0998E] hover:text-[#0A0A0A] transition-colors"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<line x1="19" y1="12" x2="5" y2="12" />
|
||||
<polyline points="12 19 5 12 12 5" />
|
||||
</svg>
|
||||
ANA SAYFAYA DÖN
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 30 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.8, ease: expo }}
|
||||
className="bg-[#F4F0E8] border-2 border-[#0A0A0A] p-10 relative shadow-[8px_8px_0px_0px_#0A0A0A]"
|
||||
>
|
||||
{/* Accent Ribbon */}
|
||||
<div className="absolute top-0 left-0 right-0 h-2 bg-[#FFE600]" />
|
||||
|
||||
{/* Logo Monogram */}
|
||||
<div className="w-16 h-16 border-2 border-[#0A0A0A] bg-[#FFE600] text-[#0A0A0A] font-display font-black text-xl flex items-center justify-center select-none mx-auto mb-8 shadow-[4px_4px_0px_0px_#0A0A0A]">
|
||||
AYR
|
||||
</div>
|
||||
|
||||
<div className="text-center mb-8">
|
||||
<h1 className="font-display font-black text-3xl uppercase tracking-tight text-[#0A0A0A] mb-2 leading-none">
|
||||
YÖNETİCİ GİRİŞİ
|
||||
</h1>
|
||||
<p className="font-mono text-[9px] uppercase tracking-[0.2em] text-[#A0998E]">
|
||||
AYRİS TECH YÖNETİM MERKEZİ
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
{/* Error Message */}
|
||||
<AnimatePresence mode="wait">
|
||||
{error && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, x: -10 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
exit={{ opacity: 0, x: 10 }}
|
||||
className="bg-[#FFF0F0] border border-[#FF4500] text-[#FF4500] p-4 font-mono text-[10px] tracking-wide uppercase flex items-center gap-3"
|
||||
>
|
||||
<div className="w-2.5 h-2.5 bg-[#FF4500] shrink-0 animate-ping" />
|
||||
<span className="flex-grow">{error}</span>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
|
||||
{/* Username Input */}
|
||||
<div className="space-y-2">
|
||||
<label className="block font-mono text-[9px] uppercase tracking-[0.2em] text-[#6A6460]">
|
||||
KULLANICI ADI
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
disabled={loading}
|
||||
className="w-full font-mono text-xs bg-[#EDE8E0] border border-[#C8C2B8] hover:border-[#0A0A0A] focus:border-[#0A0A0A] focus:bg-[#EDE8E0] outline-none px-4 py-3.5 text-[#0A0A0A] transition-all"
|
||||
placeholder="Örn: admin"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Password Input */}
|
||||
<div className="space-y-2">
|
||||
<label className="block font-mono text-[9px] uppercase tracking-[0.2em] text-[#6A6460]">
|
||||
ŞİFRE
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
required
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
disabled={loading}
|
||||
className="w-full font-mono text-xs bg-[#EDE8E0] border border-[#C8C2B8] hover:border-[#0A0A0A] focus:border-[#0A0A0A] focus:bg-[#EDE8E0] outline-none px-4 py-3.5 text-[#0A0A0A] transition-all"
|
||||
placeholder="••••••••"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Submit Button */}
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="w-full border-2 border-[#0A0A0A] bg-[#FFE600] hover:bg-[#FFE600] text-[#0A0A0A] py-4 font-display font-black text-xs tracking-[0.2em] uppercase transition-all shadow-[4px_4px_0px_0px_#0A0A0A] hover:shadow-[2px_2px_0px_0px_#0A0A0A] hover:translate-x-[2px] hover:translate-y-[2px] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none cursor-pointer flex items-center justify-center gap-2"
|
||||
>
|
||||
{loading ? (
|
||||
<>
|
||||
<div className="w-3.5 h-3.5 border-2 border-[#0A0A0A] border-t-transparent rounded-full animate-spin shrink-0" />
|
||||
BAĞLANIYOR...
|
||||
</>
|
||||
) : (
|
||||
"SİSTEME GİRİŞ YAP"
|
||||
)}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{/* Decorative Security Footer */}
|
||||
<div className="mt-8 pt-6 border-t border-[#C8C2B8] flex justify-between items-center text-[#A0998E] font-mono text-[8px] tracking-widest uppercase">
|
||||
<span>SECURE SHELL v2.4</span>
|
||||
<span className="text-[#00CC77] font-bold">● ONLINE</span>
|
||||
</div>
|
||||
</motion.div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import AdminClient from "@/components/AdminClient";
|
||||
import { getProjects, getBlogPosts, getAdminSession, getPartners } from "@/app/actions";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return [{ lang: "tr" }, { lang: "en" }];
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
return {
|
||||
title: "Yönetim Paneli | Ayris Tech",
|
||||
description: "Ayris Tech sistem, proje ve site ayarları yönetim merkezi.",
|
||||
};
|
||||
}
|
||||
|
||||
export default async function AdminPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
|
||||
// Guard dashboard route against unauthenticated users
|
||||
const session = await getAdminSession();
|
||||
if (!session) {
|
||||
redirect(`/${lang}/admin/login`);
|
||||
}
|
||||
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const initialDbProjects = await getProjects();
|
||||
const initialDbBlogPosts = await getBlogPosts();
|
||||
const initialDbPartners = await getPartners();
|
||||
|
||||
// Convert DB format to expected BlogPost format
|
||||
const initialBlogPosts = initialDbBlogPosts.map((dbPost) => ({
|
||||
id: dbPost.id,
|
||||
slug: dbPost.slug,
|
||||
date: dbPost.date,
|
||||
author: dbPost.author,
|
||||
authorRole: dbPost.authorRole,
|
||||
image: dbPost.image,
|
||||
tr: {
|
||||
title: dbPost.trTitle,
|
||||
excerpt: dbPost.trExcerpt,
|
||||
readingTime: dbPost.trReadingTime,
|
||||
category: dbPost.trCategory,
|
||||
tags: dbPost.trTags,
|
||||
content: dbPost.trContent,
|
||||
},
|
||||
en: {
|
||||
title: dbPost.enTitle,
|
||||
excerpt: dbPost.enExcerpt,
|
||||
readingTime: dbPost.enReadingTime,
|
||||
category: dbPost.enCategory,
|
||||
tags: dbPost.enTags,
|
||||
content: dbPost.enContent,
|
||||
}
|
||||
}));
|
||||
|
||||
// Convert DB Project format to standard ProjectData format (mapping fields properly)
|
||||
const initialProjects = initialDbProjects.map((p) => ({
|
||||
id: p.id,
|
||||
num: p.num,
|
||||
slug: p.slug,
|
||||
title: p.title,
|
||||
tag: p.tag,
|
||||
desc: p.desc,
|
||||
spec: p.spec,
|
||||
year: p.year,
|
||||
client: p.client,
|
||||
duration: p.duration,
|
||||
tech: p.tech,
|
||||
challenge: p.challenge,
|
||||
solution: p.solution,
|
||||
results: p.results,
|
||||
image: p.image,
|
||||
gallery: p.gallery,
|
||||
website: p.website,
|
||||
}));
|
||||
|
||||
// Map database Partners
|
||||
const initialPartners = initialDbPartners.map((p) => ({
|
||||
id: p.id,
|
||||
name: p.name,
|
||||
tag: p.tag,
|
||||
mono: p.mono,
|
||||
year: p.year,
|
||||
desc: p.desc,
|
||||
}));
|
||||
|
||||
return (
|
||||
<AdminClient
|
||||
lang={lang}
|
||||
dict={dict}
|
||||
initialProjects={initialProjects}
|
||||
initialBlogPosts={initialBlogPosts}
|
||||
initialPartners={initialPartners}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import { getBlogPosts } from "@/app/actions";
|
||||
import BlogDetailClient from "@/components/BlogDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
// Convert DB format to expected BlogPost format
|
||||
function mapBlogPost(dbPost: any) {
|
||||
return {
|
||||
id: dbPost.id,
|
||||
slug: dbPost.slug,
|
||||
date: dbPost.date,
|
||||
author: dbPost.author,
|
||||
authorRole: dbPost.authorRole,
|
||||
image: dbPost.image,
|
||||
tr: {
|
||||
title: dbPost.trTitle,
|
||||
excerpt: dbPost.trExcerpt,
|
||||
readingTime: dbPost.trReadingTime,
|
||||
category: dbPost.trCategory,
|
||||
tags: dbPost.trTags,
|
||||
content: dbPost.trContent,
|
||||
},
|
||||
en: {
|
||||
title: dbPost.enTitle,
|
||||
excerpt: dbPost.enExcerpt,
|
||||
readingTime: dbPost.enReadingTime,
|
||||
category: dbPost.enCategory,
|
||||
tags: dbPost.enTags,
|
||||
content: dbPost.enContent,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const langs: Locale[] = ["en", "tr"];
|
||||
const dbPosts = await getBlogPosts();
|
||||
|
||||
const slugs = dbPosts.length > 0
|
||||
? dbPosts.map((p) => p.slug)
|
||||
: [
|
||||
"real-time-anomaly-detection-ai",
|
||||
"web3-consortium-networks-logistics",
|
||||
"headless-ecommerce-conversion-rates",
|
||||
];
|
||||
|
||||
return langs.flatMap((lang) =>
|
||||
slugs.map((slug) => ({ lang, slug }))
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dbPosts = await getBlogPosts();
|
||||
|
||||
const dbPost = dbPosts.find((p) => p.slug === slug);
|
||||
if (!dbPost) return { title: "Not Found" };
|
||||
|
||||
const post = mapBlogPost(dbPost);
|
||||
const content = post[lang] || post.en;
|
||||
return {
|
||||
title: `${content.title} | Ayris Tech`,
|
||||
description: content.excerpt,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function BlogPostPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbPosts = await getBlogPosts();
|
||||
const dbPost = dbPosts.find((p) => p.slug === slug);
|
||||
|
||||
if (!dbPost) notFound();
|
||||
|
||||
const post = mapBlogPost(dbPost);
|
||||
|
||||
return <BlogDetailClient lang={lang} dict={dict} post={post} />;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import BlogClient from "@/components/BlogClient";
|
||||
import { getBlogPosts } from "@/app/actions";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.blog.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.blog.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function BlogPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbPosts = await getBlogPosts();
|
||||
|
||||
const initialPosts = dbPosts.map((dbPost) => ({
|
||||
id: dbPost.id,
|
||||
slug: dbPost.slug,
|
||||
date: dbPost.date,
|
||||
author: dbPost.author,
|
||||
authorRole: dbPost.authorRole,
|
||||
image: dbPost.image,
|
||||
tr: {
|
||||
title: dbPost.trTitle,
|
||||
excerpt: dbPost.trExcerpt,
|
||||
readingTime: dbPost.trReadingTime,
|
||||
category: dbPost.trCategory,
|
||||
tags: dbPost.trTags,
|
||||
content: dbPost.trContent,
|
||||
},
|
||||
en: {
|
||||
title: dbPost.enTitle,
|
||||
excerpt: dbPost.enExcerpt,
|
||||
readingTime: dbPost.enReadingTime,
|
||||
category: dbPost.enCategory,
|
||||
tags: dbPost.enTags,
|
||||
content: dbPost.enContent,
|
||||
}
|
||||
}));
|
||||
|
||||
return <BlogClient lang={lang} dict={dict} initialPosts={initialPosts} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import ContactClient from "@/components/ContactClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.contact.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.contact.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ContactPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <ContactClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import FAQClient from "@/components/FAQClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.faq.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.faq.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function FAQPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <FAQClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Archivo, Space_Grotesk, IBM_Plex_Mono } from "next/font/google";
|
||||
import "../globals.css";
|
||||
import { Locale, i18n } from "@/i18n-config";
|
||||
|
||||
const archivo = Archivo({
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700", "900"],
|
||||
variable: "--font-archivo",
|
||||
});
|
||||
|
||||
const spaceGrotesk = Space_Grotesk({
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700"],
|
||||
variable: "--font-space-grotesk",
|
||||
});
|
||||
|
||||
const ibmPlexMono = IBM_Plex_Mono({
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700"],
|
||||
variable: "--font-ibm-plex-mono",
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Ayris Tech | Forging the Future with AI & Blockchain",
|
||||
description: "Ayris Tech delivers enterprise-grade digital transformation. We build the impossible for the next generation of business using AI, Blockchain, and modern web technologies.",
|
||||
keywords: ["AI Solutions", "Blockchain Development", "Mobile App", "Web Development", "Digital Transformation"],
|
||||
};
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return i18n.locales.map((locale) => ({ lang: locale }));
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ lang: string }>;
|
||||
}) {
|
||||
const { lang } = await params;
|
||||
return (
|
||||
<html lang={lang} className="scroll-smooth">
|
||||
<body className={`${archivo.variable} ${spaceGrotesk.variable} ${ibmPlexMono.variable} font-body bg-[#F4F0E8] text-[#0A0A0A] antialiased`}>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import HomeClient from "@/components/HomeClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.nav.brandName}${dict.nav.brandSub} | ${dict.hero.badge}`,
|
||||
description: dict.hero.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Page({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <HomeClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import PartnersClient from "@/components/PartnersClient";
|
||||
import { getPartners } from "@/app/actions";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return [{ lang: "tr" }, { lang: "en" }];
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.partners.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.partners.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function PartnersPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
const partners = await getPartners();
|
||||
|
||||
return <PartnersClient lang={lang} dict={dict} initialPartners={partners} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import ProcessClient from "@/components/ProcessClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.process.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.process.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ProcessPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <ProcessClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import ServicesClient from "@/components/ServicesClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.services.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.services.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ServicesPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <ServicesClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import WorkDetailClient from "@/components/WorkDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getProjects } from "@/app/actions";
|
||||
|
||||
// ── Static params for all slug × lang combinations ──
|
||||
export async function generateStaticParams() {
|
||||
const langs: Locale[] = ["en", "tr"];
|
||||
const dbProjects = await getProjects();
|
||||
|
||||
const slugs = dbProjects.length > 0
|
||||
? dbProjects.map((p) => p.slug)
|
||||
: [
|
||||
"financeai-dashboard",
|
||||
"chainsupply-network",
|
||||
"meditrack-mobile",
|
||||
"novamart-platform",
|
||||
];
|
||||
|
||||
return langs.flatMap((lang) =>
|
||||
slugs.map((slug) => ({ lang, slug }))
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbProjects = await getProjects();
|
||||
const items = dbProjects.length > 0 ? dbProjects : (dict.work.items as any[]);
|
||||
const project = items.find((p: any) => p.slug === slug);
|
||||
if (!project) return { title: "Not Found" };
|
||||
|
||||
return {
|
||||
title: `${project.title} — ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: project.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function WorkDetailPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbProjects = await getProjects();
|
||||
const items = dbProjects.length > 0 ? dbProjects : (dict.work.items as any[]);
|
||||
const project = items.find((p: any) => p.slug === slug);
|
||||
|
||||
if (!project) notFound();
|
||||
|
||||
// Determine prev/next
|
||||
const currentIdx = items.findIndex((p: any) => p.slug === slug);
|
||||
const prev = currentIdx > 0 ? items[currentIdx - 1] : null;
|
||||
const next = currentIdx < items.length - 1 ? items[currentIdx + 1] : null;
|
||||
|
||||
return (
|
||||
<WorkDetailClient
|
||||
lang={lang}
|
||||
dict={dict}
|
||||
project={project}
|
||||
prev={prev}
|
||||
next={next}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import WorkClient from "@/components/WorkClient";
|
||||
import { getProjects } from "@/app/actions";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.work.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.work.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function WorkPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
const projects = await getProjects();
|
||||
|
||||
return <WorkClient lang={lang} dict={dict} initialProjects={projects} />;
|
||||
}
|
||||
Reference in New Issue
Block a user