const SAFE_SCHEMES = new Set(["http:", "https:", "mailto:", "tel:"]);

export function safeUrl(url: string | null | undefined): string {
  if (!url) return "#";
  try {
    return SAFE_SCHEMES.has(new URL(url).protocol) ? url : "#";
  } catch {
    return "#";
  }
}
