Files
marmarislocal/app/[locale]/admin/widget-partners/page.tsx
T

109 lines
5.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { mockDb } from '@/lib/mockDb'
import { Link } from '@/i18n/routing'
import { Globe, Calendar, CheckCircle, ExternalLink } from 'lucide-react'
export default async function AdminWidgetPartnersPage() {
const partners = await mockDb.getWidgetPartners()
return (
<div className="space-y-6">
<div>
<h2 className="text-3xl font-heading font-extrabold text-pine lowercase">widget ortakları (backlinks)</h2>
<p className="text-ink/65 text-xs font-medium mt-1">
Ajans sinerjisi kapsamında Marmaris Local bölgesel öneri widget'ını kendi web sitelerine yerleştiren anlaşmalı işletmeler.
</p>
</div>
{/* Stats row */}
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
<div className="bg-paper p-6 rounded-2xl border border-pine/8 shadow-sm">
<span className="text-[10px] font-mono text-shutter uppercase tracking-wider block mb-1">Toplam Partner</span>
<span className="text-3xl font-heading font-extrabold text-pine leading-none">{partners.length}</span>
</div>
<div className="bg-paper p-6 rounded-2xl border border-pine/8 shadow-sm">
<span className="text-[10px] font-mono text-shutter uppercase tracking-wider block mb-1">Aktif Backlinks</span>
<span className="text-3xl font-heading font-extrabold text-turquoise leading-none">{partners.filter(p => p.widgetSiteUrl).length}</span>
</div>
<div className="bg-paper p-6 rounded-2xl border border-pine/8 shadow-sm">
<span className="text-[10px] font-mono text-shutter uppercase tracking-wider block mb-1">Pilot Bölge</span>
<span className="text-3xl font-heading font-extrabold text-bougainvillea leading-none">yat limanı</span>
</div>
</div>
{/* Partner List Table */}
<div className="bg-paper border border-pine/8 rounded-2xl shadow-sm overflow-hidden">
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-pine/8 text-sm">
<thead className="bg-stone-deep/40 text-shutter font-mono text-[10px] uppercase tracking-wider">
<tr>
<th className="px-6 py-4 text-left">Mekan</th>
<th className="px-6 py-4 text-left">Mahalle</th>
<th className="px-6 py-4 text-left">Kurulum Tarihi</th>
<th className="px-6 py-4 text-left">Müşteri Web Sitesi</th>
<th className="px-6 py-4 text-left">Durum</th>
</tr>
</thead>
<tbody className="divide-y divide-dashed divide-pine/8 text-ink/80">
{partners.length === 0 ? (
<tr>
<td colSpan={5} className="px-6 py-12 text-center text-xs text-shutter font-medium">
Henüz widget kurulumu yapılmış partner bulunmuyor.
</td>
</tr>
) : (
partners.map((partner) => {
return (
<tr key={partner.id} className="hover:bg-stone/20 transition duration-150">
<td className="px-6 py-4 font-medium">
<Link href={`/admin/listings/${partner.id}`} className="font-heading font-bold text-pine lowercase text-sm hover:text-turquoise transition-colors">
{partner.nameTr}
</Link>
<div className="text-[10px] text-shutter font-mono uppercase tracking-wider mt-0.5">{partner.category?.nameTr}</div>
</td>
<td className="px-6 py-4 font-medium text-xs">
{partner.neighborhood?.nameTr}
</td>
<td className="px-6 py-4 font-mono text-xs">
{partner.widgetInstalledAt ? (
<div className="flex items-center gap-1">
<Calendar className="w-3.5 h-3.5 text-shutter/60" />
{new Date(partner.widgetInstalledAt).toLocaleDateString('tr-TR')}
</div>
) : (
'-'
)}
</td>
<td className="px-6 py-4 font-mono text-xs">
{partner.widgetSiteUrl ? (
<a
href={partner.widgetSiteUrl}
target="_blank"
rel="noopener noreferrer"
className="text-turquoise hover:underline flex items-center gap-1 font-medium"
>
<Globe className="w-3.5 h-3.5 shrink-0" />
{partner.widgetSiteUrl.replace('https://', '')}
<ExternalLink className="w-3 h-3" />
</a>
) : (
'-'
)}
</td>
<td className="px-6 py-4 whitespace-nowrap">
<span className="inline-flex items-center gap-1 rounded-full bg-paper px-2.5 py-0.5 text-[10px] font-mono font-bold text-turquoise border border-turquoise/20 uppercase tracking-wider">
<CheckCircle className="w-3.5 h-3.5" />
widget aktif
</span>
</td>
</tr>
)
})
)}
</tbody>
</table>
</div>
</div>
</div>
)
}