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

start_idx = -1
end_idx = -1
for i, l in enumerate(lines):
    if "const readFbCache = React.useCallback" in l:
        start_idx = i - 1
    if "const orderGrowth" in l:
        end_idx = i - 1
        break

if start_idx != -1 and end_idx != -1:
    del lines[start_idx:end_idx]

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