def safe_preview(url: str): if not url: return "No preview available" blocked = ["pdf", "download"] if any(b in url.lower() for b in blocked): return "Preview disabled (redaction-protected document)" return f""