İletişim Bilgileri
@@ -34,7 +34,12 @@ export default async function ContactPage() {
diff --git a/app/(public)/loading.tsx b/app/(public)/loading.tsx
new file mode 100644
index 0000000..1a8941b
--- /dev/null
+++ b/app/(public)/loading.tsx
@@ -0,0 +1,33 @@
+import { Skeleton } from "@/components/ui/skeleton"
+
+export default function PublicLoading() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/app/(public)/products/[id]/page.tsx b/app/(public)/products/[id]/page.tsx
new file mode 100644
index 0000000..3d2ac23
--- /dev/null
+++ b/app/(public)/products/[id]/page.tsx
@@ -0,0 +1,105 @@
+import { createClient } from "@/lib/supabase-server"
+import { getSiteContents } from "@/lib/data"
+import { notFound } from "next/navigation"
+import Image from "next/image"
+import Link from "next/link"
+import { Button } from "@/components/ui/button"
+import { Badge } from "@/components/ui/badge"
+import { Phone } from "lucide-react"
+import { ProductGallery } from "@/components/product/product-gallery"
+
+async function getProduct(id: string) {
+ const supabase = createClient()
+
+ // Fetch product
+ const { data: product, error } = await supabase
+ .from("products")
+ .select("*")
+ .eq("id", id)
+ .eq("is_active", true)
+ .single()
+
+ if (error || !product) {
+ return null
+ }
+
+ // Fetch images
+ const { data: images } = await supabase
+ .from("product_images")
+ .select("*")
+ .eq("product_id", id)
+ .order("display_order", { ascending: true })
+
+ return { ...product, images: images || [] }
+}
+
+export default async function ProductPage({ params }: { params: { id: string } }) {
+ const product = await getProduct(params.id)
+ const siteSettings = await getSiteContents()
+ const whatsappPhone = siteSettings.contact_phone ? siteSettings.contact_phone.replace(/\s+/g, '') : "905555555555"
+
+ if (!product) {
+ notFound()
+ }
+
+ // Combine main image and gallery images for a full list, filtering duplicates if necessary
+ // Logic: If gallery images exist, use them. If not, fallback to product.image_url.
+ // If product.image_url is in product_images, we might duplicate, but let's just use all distinct.
+
+ let allImages: string[] = []
+ if (product.images && product.images.length > 0) {
+ allImages = product.images.map((img: { image_url: string }) => img.image_url)
+ } else if (product.image_url) {
+ allImages = [product.image_url]
+ }
+
+ return (
+
+
+ {/* Image Gallery Section */}
+
+
+ {/* Product Info Section */}
+
+
+
+
+ {product.category}
+
+ {product.product_code && (
+
+ Kod: {product.product_code}
+
+ )}
+
+
+ {product.name}
+
+ {/* NO PRICE DISPLAY as requested */}
+
+
+
+
Ürün Açıklaması
+
+ {product.description || "Bu ürün için henüz detaylı açıklama eklenmemiştir."}
+
+
+
+
+
+
+
+
+ * Bu ürün hakkında detaylı bilgi ve fiyat teklifi almak için bizimle iletişime geçebilirsiniz.
+
+
+
+
+
+ )
+}
diff --git a/app/(public)/products/page.tsx b/app/(public)/products/page.tsx
index db16c5b..700d45b 100644
--- a/app/(public)/products/page.tsx
+++ b/app/(public)/products/page.tsx
@@ -2,6 +2,7 @@
import { createClient } from "@/lib/supabase-server"
import { Card, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
+import Link from "next/link"
import Image from "next/image"
@@ -57,14 +58,20 @@ export default async function ProductsPage() {
{product.category}
- ₺{product.price}
+ {product.product_code && (
+ #{product.product_code}
+ )}
{product.name}
))
diff --git a/components/contact/contact-form.tsx b/components/contact/contact-form.tsx
index ffeaaf1..18d0363 100644
--- a/components/contact/contact-form.tsx
+++ b/components/contact/contact-form.tsx
@@ -62,19 +62,19 @@ export function ContactForm() {