import os
import re

replacements = [
    (r'https://images.unsplash.com/photo-1500382017468-9049fed747ef\?w=800&q=80', 'https://images.pexels.com/photos/1580466/pexels-photo-1580466.jpeg?auto=compress&cs=tinysrgb&w=800'),
    (r'https://images.unsplash.com/photo-1500382017468-9049fed747ef\?w=1600&q=80', 'https://images.pexels.com/photos/1580466/pexels-photo-1580466.jpeg?auto=compress&cs=tinysrgb&w=1600'),
    (r'https://images.unsplash.com/photo-1500382017468-9049fed747ef\?w=200&q=60', 'https://images.pexels.com/photos/1580466/pexels-photo-1580466.jpeg?auto=compress&cs=tinysrgb&w=200'),
    (r'https://images.unsplash.com/photo-1560693559-9bce5ab15d37\?w=800&q=80', 'https://images.pexels.com/photos/235615/pexels-photo-235615.jpeg?auto=compress&cs=tinysrgb&w=800'),
    (r'https://images.unsplash.com/photo-1625246333195-78d9c38ad449\?w=800&q=80', 'https://images.pexels.com/photos/974314/pexels-photo-974314.jpeg?auto=compress&cs=tinysrgb&w=800'),
    (r'https://images.unsplash.com/photo-1447933601403-0c6688de566e\?w=800&q=80', 'https://images.pexels.com/photos/209148/pexels-photo-209148.jpeg?auto=compress&cs=tinysrgb&w=800'),
    (r'https://images.unsplash.com/photo-1416879595882-3373a0480b5b\?w=800&q=80', 'https://images.pexels.com/photos/1075960/pexels-photo-1075960.jpeg?auto=compress&cs=tinysrgb&w=800'),
    (r'https://images.unsplash.com/photo-1574943320219-553eb213f72d\?w=800&q=80', 'https://images.pexels.com/photos/440731/pexels-photo-440731.jpeg?auto=compress&cs=tinysrgb&w=800')
]

for root, dirs, files in os.walk('src/app'):
    for file in files:
        if file.endswith('.tsx') or file.endswith('.ts'):
            filepath = os.path.join(root, file)
            with open(filepath, 'r') as f:
                content = f.read()
            
            new_content = content
            for old, new in replacements:
                new_content = re.sub(old, new, new_content)
                
            if new_content != content:
                with open(filepath, 'w') as f:
                    f.write(new_content)
                print(f"Updated {filepath}")

