// Daoob Real Estate — official logo (user-supplied)
// variant="mark" (default) — just the graphic, paired with text wordmark elsewhere
// variant="full" — full lockup (mark + Arabic wordmark + tagline), for splash/auth/large surfaces

const Logo = ({ size = 40, variant = "mark", className }) => {
  // Asset base — works both as standalone prototype and inside WordPress theme.
  const base = (window.DAOOB_THEME && window.DAOOB_THEME.themeUrl)
    ? window.DAOOB_THEME.themeUrl + "/assets/img/"
    : "assets/";
  const src = variant === "full" ? base + "daoob-logo.png" : base + "daoob-mark.png";
  const aspect = variant === "full" ? 1 : 804 / 727;

  return (
    <img
      src={src}
      width={variant === "full" ? size : Math.round(size * aspect)}
      height={size}
      alt="Daoob"
      className={className}
      style={{
        display: "block",
        flexShrink: 0,
        objectFit: "contain",
      }}
    />
  );
};

Object.assign(window, { Logo });
