export function cn(...a) {
  return a.filter(Boolean).join(" ");
}

export function normalizeHostname(v) {
  const s = String(v || "").trim().toLowerCase();
  return s.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
}

export function fmtDate(iso) {
  if (!iso) return "-";
  try {
    return new Date(iso).toLocaleString("fa-IR");
  } catch {
    return iso;
  }
}
