import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
    appId: 'com.onoxsoft.panel',
    appName: 'ONOX Panel',
    webDir: 'public',
    server: {
        // Production: empty webDir + load remote URL via configurable env
        // Dev: connect to local server
        url: process.env.NODE_ENV === 'production' ? undefined : 'http://10.0.2.2:8000',
        cleartext: true,
        allowNavigation: [
            'panel.onoxsoft.com',
            '*.onoxsoft.com',
            // Kullanıcının özel host'ları buraya eklenebilir
        ],
    },
    ios: {
        contentInset: 'always',
        scheme: 'ONOX',
        backgroundColor: '#0D0E12',
    },
    android: {
        allowMixedContent: false,
        captureInput: true,
        webContentsDebuggingEnabled: false,
        backgroundColor: '#0D0E12',
    },
    plugins: {
        SplashScreen: {
            launchShowDuration: 1500,
            launchAutoHide: true,
            backgroundColor: '#0D0E12',
            androidScaleType: 'CENTER_CROP',
            showSpinner: false,
        },
        PushNotifications: {
            presentationOptions: ['badge', 'sound', 'alert'],
        },
        StatusBar: {
            style: 'DARK',
            backgroundColor: '#0D0E12',
        },
        Keyboard: {
            resize: 'body',
            style: 'DARK',
        },
    },
};

export default config;
