Security: - requireAdmin() session check added to every admin-only server action (previously relied only on middleware path matching, which Next.js Server Actions don't reliably respect) - Real Prisma + bcrypt admin auth, replacing hardcoded credentials; split into an Edge-safe auth.config.ts (used by proxy.ts) and the full Prisma-backed auth.ts (route handler, server actions, server components) - Removed hardcoded fallback secret on the Instagram sync cron endpoint - Honeypot field + per-IP rate limiting on contact/business-submission forms and the analytics events endpoint Features: - AI trip planner (/plan-olustur, /plan/[id]) backed by DeepSeek, grounded to only recommend isLocalApproved listings, with a deterministic link-injection fallback for anything the model doesn't format as markdown - Interactive Leaflet/OpenStreetMap view on category listing pages - Telegram notifications for new contact messages and business submissions SEO: - Brand-consistent favicon/apple-icon/PWA icons and default Open Graph/ Twitter share images, generated via next/og (replacing default Next.js placeholders) - BreadcrumbList structured data on category and listing detail pages - Fixed two remaining raw <img> tags to use next/image Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
114 lines
4.3 KiB
TypeScript
114 lines
4.3 KiB
TypeScript
import { Link } from '@/i18n/routing'
|
|
import { getTranslations, getLocale } from 'next-intl/server'
|
|
import { mockDb } from '@/lib/mockDb'
|
|
|
|
export default async function Footer() {
|
|
const categories = await mockDb.getCategories()
|
|
const locale = await getLocale()
|
|
const getLocalizedName = (obj: any) => {
|
|
if (!obj) return ''
|
|
return locale === 'ru' ? obj.nameRu : locale === 'en' ? obj.nameEn : obj.nameTr
|
|
}
|
|
|
|
const t = await getTranslations('footer')
|
|
const nav = await getTranslations('nav')
|
|
|
|
return (
|
|
<footer className="bg-pine text-stone/85 border-t border-white/10 pt-16 pb-8 font-sans">
|
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div className="grid grid-cols-1 md:grid-cols-4 gap-10 mb-12">
|
|
|
|
{/* Logo & Info */}
|
|
<div className="md:col-span-2 space-y-4">
|
|
<Link href="/" className="flex items-center gap-3">
|
|
<div className="w-10 h-10 rounded-full border-2 border-stone flex items-center justify-center relative bg-paper shrink-0">
|
|
<div className="absolute inset-[2.5px] rounded-full border border-dashed border-turquoise" />
|
|
<span className="font-heading font-extrabold text-pine text-xs tracking-tighter">ML</span>
|
|
</div>
|
|
<h2 className="font-heading font-extrabold text-lg text-stone tracking-tight leading-none lowercase">
|
|
marmaris <span className="text-turquoise">local</span>
|
|
</h2>
|
|
</Link>
|
|
<p className="text-xs text-stone/80 max-w-sm font-medium leading-relaxed">
|
|
{t('about')}
|
|
</p>
|
|
</div>
|
|
|
|
{/* Quick Links */}
|
|
<div className="space-y-4">
|
|
<h3 className="font-heading font-semibold text-xs text-stone uppercase tracking-wider">
|
|
{nav('home')}
|
|
</h3>
|
|
<ul className="space-y-2 text-xs">
|
|
{categories.map(cat => (
|
|
<li key={cat.id}>
|
|
<Link href={`/${cat.slug}`} className="hover:text-turquoise transition-colors">
|
|
{getLocalizedName(cat)}
|
|
</Link>
|
|
</li>
|
|
))}
|
|
<li>
|
|
<Link href="/collections" className="hover:text-turquoise transition-colors">
|
|
{nav('collections')}
|
|
</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="/blog" className="hover:text-turquoise transition-colors">
|
|
{nav('blog')}
|
|
</Link>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
{/* Guidelines */}
|
|
<div className="space-y-4">
|
|
<h3 className="font-heading font-semibold text-xs text-stone uppercase tracking-wider">
|
|
Marmaris Local
|
|
</h3>
|
|
<ul className="space-y-2 text-xs">
|
|
<li>
|
|
<Link href="/about" className="hover:text-turquoise transition-colors">
|
|
{nav('about')}
|
|
</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="/contact" className="hover:text-turquoise transition-colors">
|
|
{nav('contact')}
|
|
</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="/add-business" className="hover:text-turquoise transition-colors">
|
|
{nav('addBusiness')}
|
|
</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="/login" className="hover:text-turquoise transition-colors">
|
|
{nav('admin')}
|
|
</Link>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/* Bottom Copyright & Mandatory Branding */}
|
|
<div className="border-t border-white/10 pt-8 flex flex-col sm:flex-row items-center justify-between text-xs text-stone/75 gap-4">
|
|
<p>{t('rights')}</p>
|
|
<div className="flex items-center gap-1.5 font-medium">
|
|
<span className="opacity-90">Created by</span>
|
|
<a
|
|
href="https://ayris.tech"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
className="text-stone hover:text-turquoise transition-colors duration-200 hover:underline underline-offset-4 font-semibold"
|
|
>
|
|
ayris.tech
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</footer>
|
|
)
|
|
}
|