const express = require('express');
const router = express.Router();

// Array of routes
const routes = [
    'new-transaction',
    'bank-account',
    'bank-transaction',
    'branch',
    'branch-group',
    'company',
    'customer',
    'daily-sale',
    'expense',
    'expense-group',
    'financial-summary',
    'general',
    'item',
    'merged-data',
    'monthly-expense',
    'profit',
    'report',
    'register',
    'setting',
    'sidebar',
    'stock',
    'stock-summary',
    'stock',
    'total-summary-all',
    'total-summary-daily',
    'transaction-report',
    'transaction-detail',
    'transaction',
    'transfer',
    'user',
    'hh',
    'order', // Maps to transaction-detail
    'role', // Maps to transaction
    'edit-role',
    'vcard',
    'change-password',
     'paymentHistory',
     'salesDashBoard',
     'cashOut',
     'cafe-order',
     'gps',
     'gps-user',
     'gps-tracking',
     'gps-simulation',
     'view-sms',
     'registerForms',
     'kitchen',
     'kitchen-admin',
     'attachment',
     'cafeTransfer',
     'cafeTransferAdmin',
     'cashier',
     'log-activity',
     'supervisor',
     'bono',
     'cafe-post',
     'view-post',
     'cafe-sales',
     'cafe-order-admin',
     'new-transaction-cafe',
     'special-need',
     'device-list',
     'forgot-password-page',
     'reset-password-page',
     'printed-data',
];

// Dynamically create routes
routes.forEach(route => {
    router.get(`/${route}`, (req, res) => {
        res.render('hh', { currentPage: route }); // Pass currentPage to the view
    });
});


//router.get('login',(req,res)=>{});






module.exports = router;
