import type { Locale } from "@/i18n/routes";
import type { Project } from "@/lib/models";
import { ProjectCard } from "./project-card";

export function ProjectGrid({
  projects,
  locale,
  showStance = false,
  emptyLabel,
}: {
  projects: Project[];
  locale: Locale;
  showStance?: boolean;
  emptyLabel?: string;
}) {
  if (projects.length === 0) {
    return (
      <p className="rounded border border-hairline bg-panel p-6 text-center font-mono text-sm text-muted">
        {emptyLabel ?? "—"}
      </p>
    );
  }
  return (
    <div className="grid grid-cols-1 gap-4 md:grid-cols-2">
      {projects.map((p) => (
        <ProjectCard key={p.slug} project={p} locale={locale} showStance={showStance} />
      ))}
    </div>
  );
}
