with open("resources/js/components/AdminDashboard.tsx", "r", encoding="utf-8") as f:
    content = f.read()

scroll_fn = """
  const scrollToSection = (id: string) => {
    const el = document.getElementById(id);
    if (el) el.scrollIntoView({ behavior: 'smooth' });
  };
"""

content = content.replace("  const filteredOrders = orders.filter", scroll_fn + "\n  const filteredOrders = orders.filter")

with open("resources/js/components/AdminDashboard.tsx", "w", encoding="utf-8") as f:
    f.write(content)
