diff --git a/src/app/[locale]/not-found.tsx b/src/app/[locale]/not-found.tsx
deleted file mode 100644
index 5616de8..0000000
--- a/src/app/[locale]/not-found.tsx
+++ /dev/null
@@ -1,279 +0,0 @@
-import { Metadata } from "next";
-import { getTranslations } from "next-intl/server";
-import { getProducts, getProductImage, getProductPrice } from "@/lib/saleor";
-import { getSaleorLocale, isValidLocale, DEFAULT_LOCALE } from "@/lib/i18n/locales";
-import type { Locale } from "@/lib/i18n/locales";
-import type { Product } from "@/types/saleor";
-import Link from "next/link";
-import Image from "next/image";
-import { Star, ArrowRight } from "lucide-react";
-import TrustBadges from "@/components/home/TrustBadges";
-import UrgencyMessages from "@/components/404/UrgencyMessages";
-import { headers } from "next/headers";
-
-export const metadata: Metadata = {
- title: "Page Not Found | ManoonOils",
- description: "Discover our bestselling natural oils for hair and skin care.",
-};
-
-export default async function NotFoundPage() {
- // Get locale from URL path
- const headersList = await headers();
- const pathname = headersList.get("x-invoke-path") || headersList.get("x-matched-path") || "/";
-
- // Extract locale from path (e.g., /en/products → en, /sr/products → sr)
- const pathSegments = pathname.split("/").filter(Boolean);
- const potentialLocale = pathSegments[0];
- const validLocale = isValidLocale(potentialLocale) ? potentialLocale : DEFAULT_LOCALE;
-
- const t = await getTranslations({ locale: validLocale, namespace: "NotFound" });
- const productReviewT = await getTranslations({ locale: validLocale, namespace: "ProductReviews" });
-
- const saleorLocale = getSaleorLocale(validLocale as Locale);
-
- // Fetch products
- let products: Product[] = [];
- try {
- products = await getProducts(saleorLocale);
- } catch (error) {
- console.error("Error fetching products for 404 page:", error);
- }
-
- // Get first 4 products as bestsellers
- const bestsellers = products.slice(0, 4);
-
- // Get product reviews for rotation
- const productReviews = productReviewT.raw("reviews") as Array<{
- id: number;
- name: string;
- location: string;
- text: string;
- rating: number;
- }>;
-
- // Track 404 page view via OpenPanel (client-side will handle this)
- const referer = headersList.get("referer") || "";
-
- return (
-
- {/* Hero Section */}
-
-
-
-
- {t("title")}
-
-
- {t("subtitle")}
-
-
-
- {t("shopBestsellers")}
-
-
-
-
-
-
- {/* Trust Badges */}
-
-
- {/* Urgency Messages */}
-
-
- {/* Bestsellers Section */}
-
-
-
-
- Popular
-
-
- {t("bestsellersTitle")}
-
-
-
- {bestsellers.length > 0 ? (
-
- {bestsellers.map((product, index) => {
- const image = getProductImage(product);
- const price = getProductPrice(product);
- const isAvailable = product.variants?.[0]?.quantityAvailable > 0;
-
- return (
-
-
-
- {image ? (
-
- ) : (
-
- No Image
-
- )}
-
- {!isAvailable && (
-
-
- Out of Stock
-
-
- )}
-
-
-
-
-
-
-
-
- {product.name}
-
-
- {price || "Contact for price"}
-
-
-
-
- );
- })}
-
- ) : (
-
-
No products available at the moment.
-
- )}
-
-
-
- {/* Testimonials Section */}
-
-
-
-
- Testimonials
-
-
- {t("testimonialsTitle")}
-
-
-
-
- {productReviews.slice(0, 6).map((review, index) => (
-
-
- {[...Array(5)].map((_, i) => (
-
- ))}
-
-
- “{review.text}”
-
-
-
- {review.name.charAt(0)}
-
-
-
{review.name}
-
{review.location}
-
-
-
- ))}
-
-
-
-
- {/* Final CTA Section */}
-
-
-
-
- {t("finalCTATitle")}
-
-
- {t("finalCTASubtitle")}
-
-
-
- {t("viewAllProducts")}
-
-
-
-
-
-
- {/* OpenPanel Tracking Script */}
-
-
-
-
- );
-}
diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx
index b1823f3..4f0524c 100644
--- a/src/app/not-found.tsx
+++ b/src/app/not-found.tsx
@@ -7,8 +7,6 @@ import type { Product } from "@/types/saleor";
import Link from "next/link";
import Image from "next/image";
import { Star, ArrowRight } from "lucide-react";
-import TrustBadges from "@/components/home/TrustBadges";
-import UrgencyMessages from "@/components/404/UrgencyMessages";
import { headers } from "next/headers";
export const metadata: Metadata = {
@@ -51,15 +49,21 @@ export default async function NotFoundPage() {
rating: number;
}>;
- // Track 404 page view via OpenPanel (client-side will handle this)
- const referer = headersList.get("referer") || "";
+ // Get urgency messages
+ const urgencyMessages = [
+ t("urgency1"),
+ t("urgency2"),
+ t("urgency3", { amount: "3,000" }),
+ t("urgency4"),
+ t("urgency5"),
+ ];
return (
{/* Hero Section */}
-
+
{t("title")}
@@ -78,18 +82,19 @@ export default async function NotFoundPage() {
- {/* Trust Badges */}
-
-
- {/* Urgency Messages */}
-
+ {/* Urgency Messages - Static display of first message */}
+
+
+
+ {urgencyMessages[0]}
+
+
+
{/* Bestsellers Section */}
-
+
Popular
@@ -100,7 +105,7 @@ export default async function NotFoundPage() {
{bestsellers.length > 0 ? (
- {bestsellers.map((product, index) => {
+ {bestsellers.map((product) => {
const image = getProductImage(product);
const price = getProductPrice(product);
const isAvailable = product.variants?.[0]?.quantityAvailable > 0;
@@ -109,8 +114,6 @@ export default async function NotFoundPage() {
@@ -137,12 +140,9 @@ export default async function NotFoundPage() {
)}
-
+
+ View Product
+
@@ -170,9 +170,7 @@ export default async function NotFoundPage() {
{/* Testimonials Section */}
-
+
Testimonials
@@ -182,7 +180,7 @@ export default async function NotFoundPage() {
- {productReviews.slice(0, 6).map((review, index) => (
+ {productReviews.slice(0, 6).map((review) => (
))}
+
“{review.text}”
+
{review.name.charAt(0)}
@@ -220,9 +220,7 @@ export default async function NotFoundPage() {
{/* Final CTA Section */}
-
+
{t("finalCTATitle")}
@@ -240,20 +238,6 @@ export default async function NotFoundPage() {
-
- {/* OpenPanel Tracking Script */}
-
);
}