export type Project = {
  id: string;
  title_fr: string;
  title_en: string;
  description_fr: string;
  description_en: string;
  image?: string | null;
  createdAt: string;
};

export async function getProjects(): Promise<Project[]> {
  const res = await fetch("http://localhost:3000/api/projects", {
    cache: "no-store",
  });

  if (!res.ok) return [];

  return res.json();
}