Initial Changes

This commit is contained in:
2025-03-01 15:29:32 +05:30
parent 12caeee710
commit e4d8b2cf58
20 changed files with 330 additions and 175 deletions

View File

@@ -5,6 +5,7 @@ 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 "";
@@ -15,6 +16,8 @@ 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 =
@@ -25,7 +28,11 @@ const CategoryHero = ({ params }) => {
<section className="relative h-[50vh] flex items-center justify-center overflow-hidden">
<div className="absolute inset-0 z-0">
<Image
src="/sidhi-mala/Artboard_1_bf5ccd46-7152-4355-82a8-9e9f27c1bfc2.jpg"
src={`${
selectedCategory?.image
? backendUrl + selectedCategory?.image
: "/sidhi-mala/Artboard_1_bf5ccd46-7152-4355-82a8-9e9f27c1bfc2.jpg"
}`}
alt="Category Background"
layout="fill"
objectFit="cover"
@@ -56,7 +63,6 @@ const CategoryHero = ({ params }) => {
),
}}
/>
</div>
</section>
);