// Script to add onHotelDiscountsClick to all pages in App.tsx
const fs = require('fs');

const filePath = './App.tsx';
let content = fs.readFileSync(filePath, 'utf8');

// Pattern to find: onEsimsClick={() => setCurrentPage('esims')}
// followed by newline and NOT already having onHotelDiscountsClick

const pattern = /(onEsimsClick=\{\(\) => setCurrentPage\('esims'\)\})\n(\s+)(currentPage=)/g;
const replacement = `$1\n$2onHotelDiscountsClick={() => setCurrentPage('hotel-discounts')}\n$2$3`;

content = content.replace(pattern, replacement);

fs.writeFileSync(filePath, content, 'utf8');
console.log('Updated App.tsx with onHotelDiscountsClick');
