'use client'; import React, { useState, useEffect } from 'react'; import { Zap, ShieldCheck, Save, RefreshCcw, Wallet, Settings, Server, Key, AlertCircle } from 'lucide-react'; export default function AdminSettingsPage() { const [settings, setSettings] = useState({ sol_platform_address: '', evm_platform_address: '', default_fee_percent: '1.0' }); const [isLoading, setIsLoading] = useState(true); const [isSaving, setIsSaving] = useState(false); const [message, setMessage] = useState({ type: '', text: '' }); useEffect(() => { fetchSettings(); }, []); const fetchSettings = async () => { setIsLoading(true); try { const res = await fetch('/api/admin/settings'); const data = await res.json(); if (data.error) throw new Error(data.error); setSettings({ sol_platform_address: data.sol_platform_address || '', evm_platform_address: data.evm_platform_address || '', default_fee_percent: data.default_fee_percent || '1.0' }); } catch (err: any) { setMessage({ type: 'error', text: 'Ayarlar yüklenemedi: ' + err.message }); } finally { setIsLoading(false); } }; const handleSave = async (e: React.FormEvent) => { e.preventDefault(); setIsSaving(true); setMessage({ type: '', text: '' }); try { const res = await fetch('/api/admin/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(settings) }); const data = await res.json(); if (data.error) throw new Error(data.error); setMessage({ type: 'success', text: 'Ayarlar başarıyla güncellendi.' }); } catch (err: any) { setMessage({ type: 'error', text: 'Kaydetme hatası: ' + err.message }); } finally { setIsSaving(false); } }; return (
{/* Header */}

Platform Ayarları

Sistem Genel Yapılandırması

Global Kontrol Ünitesi
{/* Main Form */}
{/* Fee Setting Card */}

Komisyon (Fee) Ayarları

Sistem geneli varsayılan işlem kesintisi

%
setSettings({ ...settings, default_fee_percent: e.target.value })} className="w-full pl-8 pr-12 py-5 bg-gray-50 border-2 border-transparent focus:border-emerald-500 focus:bg-white rounded-[24px] outline-none transition-all font-black text-gray-900 text-lg" />

Örn: 1.0 (Yüzde bir), 2.5 (Yüzde iki buçuk)

{/* Platform Addresses Card */}

Merkezi Cüzdanlar (Platform)

Süpürülen tüm fonların toplanacağı ana adresler

setSettings({ ...settings, sol_platform_address: e.target.value })} placeholder="Solana Wallet Address" className="w-full pl-14 pr-6 py-5 bg-gray-50 border-2 border-transparent focus:border-purple-500 focus:bg-white rounded-[24px] outline-none transition-all font-bold text-gray-900 font-mono text-sm" />
setSettings({ ...settings, evm_platform_address: e.target.value })} placeholder="0x..." className="w-full pl-14 pr-6 py-5 bg-gray-50 border-2 border-transparent focus:border-blue-500 focus:bg-white rounded-[24px] outline-none transition-all font-bold text-gray-900 font-mono text-sm" />

Bu adresler, merchant'ların yaptığı tahsilatların (komisyonunuz kesildikten sonra kalan kısmın değil, platforma ait ana kesintinin veya tüm fonların) toplanacağı ana havuzunuzdur. Lütfen adreslerin doğruluğunu iki kez kontrol edin.

{/* Info Card: Gas Tank Secrets */}

Kritik Güvenlik: Gas Tank Private Key

Süpürme (Sweep) işlemlerinin blokzinciri ücretlerini ödeyen "Gaz Tankı" cüzdanınızın Private Key'i, en yüksek güvenlik için veritabanında değil, sunucu tarafında Coolify Environment Variables (`CRYPTO_GAS_TANK_KEY`) olarak saklanmalıdır.

Coolify Panelden Yönetildi
{/* Status and Action */} {message.text && (
{message.type === 'success' ? : } {message.text}
)}
); }