'use client'; import React from 'react'; import Link from 'next/link'; import { usePathname, useRouter } from 'next/navigation'; import { LayoutDashboard, CreditCard, ExternalLink, Terminal, Building2, ShieldCheck, LogOut, Wallet } from 'lucide-react'; export default function MerchantSidebar({ merchantId }: { merchantId: string }) { const pathname = usePathname(); const router = useRouter(); const handleLogout = async () => { try { await fetch('/api/merchants/logout', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ identifier: merchantId }) }); router.push('/'); router.refresh(); } catch (err) { console.error('Logout failed'); } }; const navItems = [ { label: 'Panel', icon: LayoutDashboard, href: `/merchant/${merchantId}` }, { label: 'İşlemler', icon: CreditCard, href: `/merchant/${merchantId}/transactions` }, { label: 'Ödemeler', icon: Wallet, href: `/merchant/${merchantId}/payouts` }, { label: 'Entegrasyon', icon: Terminal, href: `/merchant/${merchantId}/integration` }, ]; return ( ); }