import type { LucideIcon } from "@/components/ui/icons";
import { Cpu, Layout, Network, ShoppingBag, Wrench } from "@/components/ui/icons";

export type ProjectType = "vitrine" | "saas" | "ecommerce" | "outil" | "plateforme";

export type Highlight = { label: string; value: string };

export type LighthouseScores = {
  performance: number;
  accessibility: number;
  bestPractices: number;
  seo: number;
};

export type PageSpeedData = {
  mobile?: LighthouseScores;
  desktop?: LighthouseScores;
  fetchedAt?: string;
};

export type Realisation = {
  slug: string;
  name: string;
  domain: string;
  url: string;
  year: number;
  sector: string;
  type: ProjectType;
  context: string;
  tagline: string;
  summary: string;
  brief: string;
  delivered: string[];
  highlights: Highlight[];
  desktopScreenshot?: string;
  mobileScreenshot?: string;
  pagespeed?: PageSpeedData;
};

export const LIGHTHOUSE_LABELS: { key: keyof LighthouseScores; label: string }[] = [
  { key: "performance", label: "Performance" },
  { key: "accessibility", label: "Accessibilité" },
  { key: "bestPractices", label: "Bonnes pratiques" },
  { key: "seo", label: "SEO" },
];

export const TYPE_LABELS: Record<ProjectType, string> = {
  vitrine: "Site vitrine",
  saas: "Plateforme SaaS",
  ecommerce: "E-commerce",
  outil: "Outil web",
  plateforme: "Plateforme B2B",
};

export const TYPE_ICONS: Record<ProjectType, LucideIcon> = {
  vitrine: Layout,
  saas: Cpu,
  ecommerce: ShoppingBag,
  outil: Wrench,
  plateforme: Network,
};

export const PROJECT_TYPES: ProjectType[] = [
  "vitrine",
  "saas",
  "ecommerce",
  "outil",
  "plateforme",
];

export function emptyRealisation(): Realisation {
  return {
    slug: "",
    name: "",
    domain: "",
    url: "",
    year: new Date().getFullYear(),
    sector: "",
    type: "vitrine",
    context: "",
    tagline: "",
    summary: "",
    brief: "",
    delivered: [],
    highlights: [],
  };
}
