UNPKG

next-google-adsense

Version:
27 lines (26 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DummyAd = void 0; const tslib_1 = require("tslib"); const react_1 = tslib_1.__importDefault(require("react")); const DummyAd = ({ size: { width, height }, responsive = false, style = {}, className = "", label = "Advertisement", }) => { const containerStyle = Object.assign({ backgroundColor: "#f5f5f5", border: "2px dashed #ccc", display: "flex", alignItems: "center", justifyContent: "center", fontFamily: "Arial, sans-serif", fontSize: "14px", color: "#666", textAlign: "center", boxSizing: "border-box", position: "relative", minHeight: responsive ? "50px" : `${height}px` }, style); if (responsive) { containerStyle.width = "100%"; containerStyle.maxWidth = `${width}px`; containerStyle.aspectRatio = `${width} / ${height}`; } else { containerStyle.width = `${width}px`; containerStyle.height = `${height}px`; } return (react_1.default.createElement("div", { className: `dummy-ad ${className}`, style: containerStyle }, react_1.default.createElement("div", null, react_1.default.createElement("div", { style: { fontWeight: "bold", marginBottom: "4px" } }, label), react_1.default.createElement("div", { style: { fontSize: "12px", opacity: 0.7 } }, width, " \u00D7 ", height, responsive && " (Responsive)")))); }; exports.DummyAd = DummyAd;