+ {(() => {
+ const adContentUrl = conf().AD_CONTENT_URL;
+
+ // VITE_AD_CONTENT_URL=default message (null will be nothing),referal link,image link, card message
+ // Ensure adContentUrl is an array. If not, render nothing for ads.
+ if (!Array.isArray(adContentUrl)) {
+ return null;
+ }
+
+ const ad1LinkIsValid =
+ typeof adContentUrl[1] === "string" && adContentUrl[1].length > 0;
+ const ad1ImageIsProvided = typeof adContentUrl[2] === "string";
+ const showAd1 =
+ adContentUrl.length >= 2 && ad1LinkIsValid && ad1ImageIsProvided;
+
+ const ad2LinkIsValid =
+ typeof adContentUrl[3] === "string" && adContentUrl[3].length > 0;
+ const ad2ImageIsProvided = typeof adContentUrl[4] === "string";
+ const showAd2 =
+ adContentUrl.length >= 5 && ad2LinkIsValid && ad2ImageIsProvided;
+
+ return (
+ <>
+
+ {showAd1 ? (
+
+ ) : null}
+ {showAd2 ? (
+
+ ) : null}
+
+ {adContentUrl[0] !== "null" && (
+
+ )}
+ >
+ );
+ })()}