-
-
-
+
+
+
+
+
- {
- product?.category?.slug &&
- <>
-
-
+ {
+ product?.category?.slug &&
+ <>
+
+
+
+ {product.category.title}
+
+ >
+ }
+ {
+ product?.brand?.slug &&
+ <>
+
+
+ {product.brand.title}
+
+ >
+ }
+
+ {product.title}
+
- {product.category.title}
-
- >
- }
- {
- product?.brand?.slug &&
- <>
-
-
- {product.brand.title}
-
- >
- }
-
-
{product.title}
diff --git a/src/components/ContactUs/index.jsx b/src/components/ContactUs/index.jsx
index cb5ff88..ee16133 100644
--- a/src/components/ContactUs/index.jsx
+++ b/src/components/ContactUs/index.jsx
@@ -113,13 +113,20 @@ export default function ContactModal({ close, open }) {
{/* Submit Button */}
-
+
+
diff --git a/src/components/Product/ProductDescription.jsx b/src/components/Product/ProductDescription.jsx
index 625020f..d38d82b 100644
--- a/src/components/Product/ProductDescription.jsx
+++ b/src/components/Product/ProductDescription.jsx
@@ -8,7 +8,7 @@ export default async function ProductDescription({ description }) {
description &&
<>
{t.PDP.productDescription}
-
+
>
diff --git a/src/components/Product/ProductInfo.jsx b/src/components/Product/ProductInfo.jsx
index 6609dcc..e4cb26b 100644
--- a/src/components/Product/ProductInfo.jsx
+++ b/src/components/Product/ProductInfo.jsx
@@ -9,6 +9,8 @@ import ContactModal from "../ContactUs";
import { useState } from "react";
import { useTranslations } from "next-intl";
import BrandInfo from "./BrandInfo";
+import { Share2 } from "lucide-react";
+import { toast } from "react-toastify";
export default function ProductInfo({ title, price, discount, showPrice, category, summery, brand }) {
@@ -31,10 +33,39 @@ export default function ProductInfo({ title, price, discount, showPrice, categor
const t = useTranslations("ContactModal")
+ const shareLink = async () => {
+ if (navigator.share) {
+ navigator.share({
+ title: title,
+ text: 'Check out this on Advanced Horizon !',
+ url: window.location.href,
+ })
+
+ } else if (navigator.clipboard) {
+ try {
+ await navigator.clipboard.writeText(text);
+ toast.success("link copied!")
+ } catch (err) {
+ console.error('Failed to copy: ', err);
+ }
+ } else {
+ const tempInput = document.createElement('input');
+ tempInput.style.position = 'absolute';
+ tempInput.style.left = '-9999px';
+ tempInput.value = window.location.href;
+ document.body.appendChild(tempInput);
+ tempInput.select();
+ document.execCommand('copy');
+ document.body.removeChild(tempInput);
+ toast.success("link copied!")
+ }
+
+ }
+
return (
-
+
{title}
@@ -105,11 +136,14 @@ export default function ProductInfo({ title, price, discount, showPrice, categor
}
-
+
{/* Replaced Button with Tailwind CSS */}
+
);