feat: full site build — Project/Melody schema (Option A), admin CRUD, public sections, uploads, email+SMTP, internal analytics, legal pages, docs
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import type { ProjectType } from "@prisma/client";
|
||||
import type { Locale } from "@/lib/i18n";
|
||||
|
||||
export const publicProjectTypes: ProjectType[] = ["PORTFOLIO", "APP", "WEBSITE", "DESIGN"];
|
||||
|
||||
const directoryCopy = {
|
||||
ar: {
|
||||
PORTFOLIO: {
|
||||
segment: "work",
|
||||
eyebrow: "الأعمال",
|
||||
title: "مختارات من المشاريع والأعمال",
|
||||
description: "مشاريع مختارة تجمع بين الفكرة، التصميم، والتنفيذ العملي.",
|
||||
empty: "لا توجد أعمال منشورة ضمن هذا التصنيف بعد.",
|
||||
},
|
||||
WEBSITE: {
|
||||
segment: "websites",
|
||||
eyebrow: "المواقع",
|
||||
title: "مواقع جاهزة للنشر والنمو",
|
||||
description: "مواقع مبنية بهيكل واضح وتجربة استخدام متماسكة.",
|
||||
empty: "لا توجد مواقع منشورة ضمن هذا التصنيف بعد.",
|
||||
},
|
||||
DESIGN: {
|
||||
segment: "designs",
|
||||
eyebrow: "التصاميم",
|
||||
title: "هويات وتصاميم بصرية",
|
||||
description: "أعمال بصرية تركز على الوضوح، الهوية، وقابلية الاستخدام.",
|
||||
empty: "لا توجد تصاميم منشورة ضمن هذا التصنيف بعد.",
|
||||
},
|
||||
APP: {
|
||||
segment: "apps",
|
||||
eyebrow: "التطبيقات",
|
||||
title: "تطبيقات ومنتجات رقمية",
|
||||
description: "تجارب تطبيقات ومنتجات مبنية بعناية.",
|
||||
empty: "لا توجد تطبيقات منشورة ضمن هذا التصنيف بعد.",
|
||||
},
|
||||
},
|
||||
en: {
|
||||
PORTFOLIO: {
|
||||
segment: "work",
|
||||
eyebrow: "Portfolio",
|
||||
title: "Selected work and projects",
|
||||
description: "A selection of projects balancing ideas, design, and practical delivery.",
|
||||
empty: "No published work is available in this category yet.",
|
||||
},
|
||||
WEBSITE: {
|
||||
segment: "websites",
|
||||
eyebrow: "Websites",
|
||||
title: "Websites built to launch and grow",
|
||||
description: "Web experiences with clear structure and a cohesive user journey.",
|
||||
empty: "No published websites are available in this category yet.",
|
||||
},
|
||||
DESIGN: {
|
||||
segment: "designs",
|
||||
eyebrow: "Designs",
|
||||
title: "Visual identities and designs",
|
||||
description: "Visual work focused on clarity, identity, and usefulness.",
|
||||
empty: "No published designs are available in this category yet.",
|
||||
},
|
||||
APP: {
|
||||
segment: "apps",
|
||||
eyebrow: "Apps",
|
||||
title: "Apps and digital products",
|
||||
description: "Carefully built application and product experiences.",
|
||||
empty: "No published apps are available in this category yet.",
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export function getProjectDirectoryCopy(locale: Locale, type: ProjectType) {
|
||||
return directoryCopy[locale][type];
|
||||
}
|
||||
|
||||
export function getProjectPath(locale: Locale, type: ProjectType, slug?: string) {
|
||||
const segment = getProjectDirectoryCopy(locale, type).segment;
|
||||
return `/${locale}/${segment}${slug ? `/${slug}` : ""}`;
|
||||
}
|
||||
|
||||
export function getProjectTypeFromSegment(segment: string): ProjectType | null {
|
||||
if (segment === "work") return "PORTFOLIO";
|
||||
if (segment === "apps") return "APP";
|
||||
if (segment === "websites") return "WEBSITE";
|
||||
if (segment === "designs") return "DESIGN";
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user