// src/components/dataMenu.js

const createMenuItem = (name, link) => ({ name, link });
const createSubMenu = (name, target, subMenus) => ({ name, target, subMenus });

const mainDashboardMenus = [
  createMenuItem('Getting Started', '/getting-started'),
  createMenuItem('Dashboard Overview', '/dashboard'),
  createMenuItem('Application Settings', '/application')
];

const biometricSubMenus = {
  faceRecognition: [
    createMenuItem('Verify Identity', '/face-verify'),
    createMenuItem('Summary Report', '/face-summary'),
    createMenuItem('Transaction Log', '/face-transaction')
  ],
  ktpOcr: [
    createMenuItem('Verify KTP', '/ktp-verify'),
    createMenuItem('Manage Basic Auth', '/ktp-manage'),
    createMenuItem('Summary of KTPs', '/ktp-summary'),
    createMenuItem('KTP Transaction History', '/ktp-transaction')
  ],
  npwpOcr: [
    createMenuItem('Verify NPWP', '/npwp-verify'),
    createMenuItem('NPWP Summary', '/npwp-summary'),
    createMenuItem('NPWP Transaction Log', '/npwp-transaction')
  ],
  simOcr: [
    createMenuItem('Verify SIM', '/sim-verify'),
    createMenuItem('SIM Summary', '/sim-summary'),
    createMenuItem('SIM Transaction Log', '/sim-transaction')
  ],
  documentOcr: [
    createMenuItem('Verify Document', '/document-verify'),
    createMenuItem('Document Summary', '/document-summary'),
    createMenuItem('Document Transaction History', '/document-transaction')
  ]
};

const smsServiceMenus = {
  smsOtp: [
    createMenuItem('Settings', '/sms-otp-settings'),
    createMenuItem('Summary Report', '/sms-otp-summary'),
    createMenuItem('Transaction Log', '/sms-otp-transaction'),
    createMenuItem('Detail View', '/sms-otp-detail')
  ],
  announcement: [
    createMenuItem('Bulk Message', '/sms-announcement-bulk'),
    createMenuItem('Announcement Summary', '/sms-announcement-summary'),
    createMenuItem('Transaction Logs', '/sms-announcement-transaction')
  ]
};

const whatsAppMenus = {
  management: [
    createMenuItem('Register Business Account', '/wa-registration'),
    createMenuItem('WhatsApp Profile Settings', '/wa-profile'),
    createMenuItem('Message Templates', '/wa-template'),
    createMenuItem('Integration Settings', '/wa-integration')
  ],
  activity: [
    createMenuItem('Settings', '/wa-settings'),
    createMenuItem('Activity Summary', '/wa-summary'),
    createMenuItem('WA Transaction Logs', '/wa-transaction'),
    createMenuItem('Bulk Sending', '/wa-bulk')
  ]
};

const identityMenus = {
  electronic: [
    createMenuItem('Verify Certificate', '/identity-electro-verify'),
    createMenuItem('Electronic Transaction', '/identity-electro-transaction')
  ],
  npwp: [
    createMenuItem('Npwp Transaction', '/identity-npwp-transaction')
  ],
  tax: [
    createMenuItem('Verify Tax Number', '/identity-tax-verify'),
    createMenuItem('Tax Transaction', '/identity-tax-transaction')
  ],
  income: [
    createMenuItem('Verify Income', '/identity-income-verify'),
    createMenuItem('Income Transaction', '/identity-income-transaction')
  ],
  id: [
    createMenuItem('Verify ID', '/identity-id-verify'),
    createMenuItem('Verify ID Transaction', '/identity-id-transaction')
  ]
};

const watchlistMenus = {
  screening: [
    createMenuItem('Verify Watchlist', '/watchlist-screening-verify'),
    createMenuItem('Admin Settings', '/watchlist-screening-admin'),
    createMenuItem('Search Watchlist', '/watchlist-screening-search'),
    createMenuItem('Transaction Logs', '/watchlist-screening-transaction'),
    createMenuItem('Monitor Watchlist', '/watchlist-screening-monitor')
  ]
};

const fileMenus = {
  screening: [
    createMenuItem('Verify File', '/files-screening-verify'),
    createMenuItem('Search Files', '/files-screening-search'),
    createMenuItem('File Management Settings', '/files-screening-admin')
  ]
};

const dataMenu = [
  {
    items: [createSubMenu('Home', 'collapseHome', mainDashboardMenus)],
    iconClass: 'fas fa-tachometer-alt'
  },
  {
    items: [{
      name: 'Biometric',
      target: 'collapseBiometric',
      subMenus: [
        createSubMenu('Face Recognition System', 'collapseFaceRecog', biometricSubMenus.faceRecognition),
        createSubMenu('KTP OCR', 'collapseOcrKtp', biometricSubMenus.ktpOcr),
        createSubMenu('NPWP OCR', 'collapseOcrNpwp', biometricSubMenus.npwpOcr),
        createSubMenu('SIM OCR', 'collapseOcrSim', biometricSubMenus.simOcr),
        createSubMenu('Document OCR', 'collapseOcrDocument', biometricSubMenus.documentOcr)
      ]
    }],
    iconClass: 'fas fa-user'
  },
  {
    items: [{
      name: 'SMS',
      target: 'collapseSms',
      subMenus: [
        createMenuItem('SMS Verification', '/sms-verify'),
        createSubMenu('SMS OTP Management', 'collapseSmsOtp', smsServiceMenus.smsOtp),
        createSubMenu('SMS Announcements', 'collapseAnnouncement', smsServiceMenus.announcement),
        createMenuItem('Blocked Numbers', '/sms-block'),
        createMenuItem('SMS Anomaly Report', '/sms-anomaly')
      ]
    }],
    iconClass: 'fas fa-phone'
  },
  {
    items: [{
      name: 'WhatsApp',
      target: 'collapseWa',
      subMenus: [
        createMenuItem('Verify WhatsApp Account', '/wa-verify'),
        createSubMenu('WhatsApp Management', 'collapseWaManage', whatsAppMenus.management),
        createSubMenu('WhatsApp Activity', 'collapseActivity', whatsAppMenus.activity),
        createMenuItem('WhatsApp Inbox', '/wa-inbox'),
        createMenuItem('Blocked WhatsApp Numbers', '/wa-block')
      ]
    }],
    iconClass: 'fab fa-whatsapp'
  },
  {
    items: [{
      name: 'Identity',
      target: 'collapseIdentify',
      subMenus: [
        createSubMenu('Electronic Certificate Verification', 'collapseElectro', identityMenus.electronic),
        createSubMenu('NPWP Verification', 'collapseIdentifyNpwp', identityMenus.npwp),
        createSubMenu('Tax Number Verification', 'collapseTax', identityMenus.tax),
        createSubMenu('Income Verification', 'collapseIncome', identityMenus.income),
        createSubMenu('ID Verification', 'collapseIdVerification', identityMenus.id)
      ]
    }],
    iconClass: 'fas fa-edit'
  },
  {
    items: [{
      name: 'Watchlist',
      target: 'collapseWatchlist',
      subMenus: [
        createSubMenu('Watchlist Screening', 'collapseScreening', watchlistMenus.screening)
      ]
    }],
    iconClass: 'fas fa-calendar'
  },
  {
    items: [{
      name: 'File',
      target: 'collapseFiles',
      subMenus: [
        createSubMenu('File Screening', 'collapseScreening', fileMenus.screening)
      ]
    }],
    iconClass: 'fas fa-cogs'
  }
];

export default dataMenu;