Files
pse.dev/lib/projectsUtils.ts
2024-10-21 00:44:12 +01:00

16 lines
351 B
TypeScript

import { projects } from "@/data/projects"
import { ProjectInterface } from "./types"
export const getProjectById = (id: string | number, lang = "en") => {
const project: ProjectInterface =
projects.filter((project) => String(project.id) === id)[0] ?? {}
const content = project?.content?.[lang]
return {
project,
content,
}
}