diff --git a/src/app/sunum/[token]/page.tsx b/src/app/sunum/[token]/page.tsx index 9cb4108..f99ebdf 100644 --- a/src/app/sunum/[token]/page.tsx +++ b/src/app/sunum/[token]/page.tsx @@ -1,5 +1,6 @@ import { notFound } from "next/navigation"; import { Query } from "node-appwrite"; +import { Building2, MapPin, Home } from "lucide-react"; import { DATABASE_ID, TABLES, type Presentation, type Property } from "@/lib/appwrite/schema"; import { createAdminClient } from "@/lib/appwrite/server"; @@ -31,16 +32,18 @@ export default async function SunumPage({ params }: Props) { if (presentation.expiresAt && new Date(presentation.expiresAt) < new Date()) { return ( -
-
-

Sunum Süresi Doldu

-

Bu sunum artık geçerli değil.

+
+
+
+ +
+

Sunum Süresi Doldu

+

Bu sunum bağlantısı artık geçerli değil.

); } - // Increment view count (fire-and-forget) void incrementPresentationViewCount(presentation.$id, presentation.viewCount ?? 0); let propertyIds: string[] = []; @@ -56,93 +59,147 @@ export default async function SunumPage({ params }: Props) { const row = await tablesDB.getRow(DATABASE_ID, TABLES.properties, pid); properties.push(row as unknown as Property); } catch { - // Property may have been deleted + // deleted } } return ( -
-
-

{presentation.title}

- {presentation.notes && ( -

{presentation.notes}

- )} -

{properties.length} ilan

+
+ {/* Hero header */} +
+
+
+ + Emlak Sunumu +
+

{presentation.title}

+ {presentation.notes && ( +

+ {presentation.notes} +

+ )} +
+ + {properties.length} + ilan listelendi + +
+
-
+ {/* Grid */} +
{properties.map((p) => ( ))} {properties.length === 0 && ( -

- Bu sunumda ilan bulunmuyor. -

+
+ +

Bu sunumda ilan bulunmuyor.

+
)}
+ + {/* Footer */} +
+ Bu sunum Kovak Emlak CRM tarafından oluşturulmuştur. +
); } function PropertyCard({ property: p }: { property: Property }) { - const isExpired = p.status === "satildi" || p.status === "kiralandit"; + const isSold = p.status === "satildi" || p.status === "kiralandit"; const imageIds = parseImageIds(p.imageIds); const coverImageId = imageIds[0]; + const statusStyle: Record = { + aktif: "bg-green-500/90 text-white", + pasif: "bg-gray-500/80 text-white", + satildi: "bg-orange-500/90 text-white", + kiralandit: "bg-blue-500/90 text-white", + }; + return ( -
-
+
+ {/* Photo */} +
{coverImageId ? ( // eslint-disable-next-line @next/next/no-img-element {p.title} ) : ( -
🏠
+
+ +
+ )} + + {/* Status badge — top left */} + + {PROPERTY_STATUS_LABELS[p.status] ?? p.status} + + + {/* Listing type — top right */} + + {LISTING_TYPE_LABELS[p.listingType] ?? p.listingType} + + + {/* Photo count pill */} + {imageIds.length > 1 && ( + + {imageIds.length} fotoğraf + )}
-
-
-

{p.title}

- - {PROPERTY_STATUS_LABELS[p.status] ?? p.status} - -
-
- {PROPERTY_TYPE_LABELS[p.propertyType] ?? p.propertyType} - · - {LISTING_TYPE_LABELS[p.listingType] ?? p.listingType} + {/* Body */} +
+

{p.title}

+ + {/* Location */} + {(p.city || p.district || p.neighborhood) && ( +
+ + + {[p.neighborhood, p.district, p.city].filter(Boolean).join(", ")} + +
+ )} + + {/* Spec pills */} +
+ + {PROPERTY_TYPE_LABELS[p.propertyType] ?? p.propertyType} + {p.roomCount && ( - <> - · - {p.roomCount} - + + {p.roomCount} + )} {p.netM2 && ( - <> - · - {p.netM2} m² - + + {p.netM2} m² + )}
-

- {[p.neighborhood, p.district, p.city].filter(Boolean).join(", ")} -

- -

- {p.price.toLocaleString("tr-TR")} {p.currency ?? "TRY"} -

+ {/* Price — pushed to bottom */} +
+

+ {p.price.toLocaleString("tr-TR")} + {p.currency ?? "TRY"} +

+
{p.description && ( -

{p.description}

+

{p.description}

)} {p.mapLat != null && p.mapLng != null && ( @@ -150,9 +207,10 @@ function PropertyCard({ property: p }: { property: Property }) { href={`https://www.google.com/maps?q=${p.mapLat},${p.mapLng}`} target="_blank" rel="noopener noreferrer" - className="inline-flex items-center gap-1 text-xs text-blue-600 hover:underline" + className="mt-1 inline-flex items-center gap-1.5 text-xs font-medium text-blue-600 hover:text-blue-700 transition-colors" > - 📍 Haritada gör + + Haritada gör )}