import type { NextConfig } from "next";

const noStore = [
  {
    key: "Cache-Control",
    value: "private, no-store, max-age=0, must-revalidate",
  },
];

const nextConfig: NextConfig = {
  images: {
    remotePatterns: [
      { protocol: "https", hostname: "images.unsplash.com" },
      { protocol: "https", hostname: "res.cloudinary.com" },
    ],
  },
  async headers() {
    return [
      {
        source: "/negocio",
        headers: noStore,
      },
      {
        source: "/negocio/:path*",
        headers: noStore,
      },
      {
        source: "/account",
        headers: noStore,
      },
      {
        source: "/account/:path*",
        headers: noStore,
      },
      {
        source: "/cart",
        headers: noStore,
      },
      {
        source: "/checkout",
        headers: noStore,
      },
      {
        source: "/checkout/:path*",
        headers: noStore,
      },
      {
        source: "/ops",
        headers: noStore,
      },
      {
        source: "/ops/:path*",
        headers: noStore,
      },
    ];
  },
  async redirects() {
    return [
      {
        source: "/product/vestido_sporty_elegance",
        destination: "/product/vestido-sporty-elegance",
        permanent: true,
      },
    ];
  },
};

export default nextConfig;
