"use client"; import { useContext } from "react"; import Image from "next/image"; import { motion } from "framer-motion"; import ProductContext from "@/app/contexts/productContext"; import { Button } from "@/components/ui/button"; import { backendUrl } from "@/utils/axios"; const cleanHTML = (html) => { if (!html) return ""; return html.replace(/style="[^"]*color:[^;]*;?"/gi, ""); }; const CategoryHero = ({ params }) => { const { category } = useContext(ProductContext); const selectedCategory = category?.find((cat) => cat.id == params.id); console.log(selectedCategory); // Fallback values const fallbackImage = "/placeholder-image.jpg"; const fallbackDescription = "Explore our curated collection of spiritual items designed to enhance your journey of self-discovery and inner peace."; const fallbackCategoryName = "Spiritual Essentials"; return (
Category Background
{selectedCategory?.category_name || fallbackCategoryName}
); }; export default CategoryHero;