import type { MetadataRoute } from "next";

export default function manifest(): MetadataRoute.Manifest {
  return {
    name: "Epicure",
    short_name: "Epicure",
    description: "Your AI-powered recipe book",
    start_url: "/recipes",
    display: "standalone",
    background_color: "#ffffff",
    theme_color: "#18181b",
    icons: [
      { src: "/icon-192.svg", sizes: "192x192", type: "image/svg+xml", purpose: "any" },
      { src: "/icon-192.svg", sizes: "192x192", type: "image/svg+xml", purpose: "maskable" },
      { src: "/icon-512.svg", sizes: "512x512", type: "image/svg+xml", purpose: "any" },
      { src: "/icon-512.svg", sizes: "512x512", type: "image/svg+xml", purpose: "maskable" },
    ],
    // Registers Epicure as a share target in the OS share sheet (Chromium
    // on Android/desktop once installed — Safari has no equivalent API).
    // Sharing a recipe link from another app opens /recipes with these
    // query params, which auto-opens the URL-import dialog pre-filled.
    share_target: {
      action: "/recipes",
      method: "GET",
      params: {
        title: "title",
        text: "text",
        url: "url",
      },
    },
  };
}
