import "server-only";
import { revalidatePath } from "next/cache";
import { locales } from "@/lib/i18n/config";

/** Invalidate the same storefront route for every supported locale. */
export function revalidateStorefront(...paths: string[]) {
  for (const locale of locales) {
    for (const path of paths) {
      revalidatePath(`/${locale}${path}`);
    }
  }
}
