bidasoa-components
Version:
Colección de componentes comunes empleados en proyectos Bidasoa.
19 lines (18 loc) • 888 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParagraphYoutubeEmbed = void 0;
const react_1 = __importDefault(require("react"));
const styled_components_1 = __importDefault(require("styled-components"));
const ParagraphYoutubeEmbed = ({ alt, src }) => {
const embeddedUrl = src.replace(/https:\/\/youtu.be\//, '');
return (react_1.default.createElement(IframeWrapper, null,
react_1.default.createElement("iframe", { title: alt, allowFullScreen: true, src: `https://www.youtube.com/embed/${embeddedUrl}`, width: "100%", height: "100%" })));
};
exports.ParagraphYoutubeEmbed = ParagraphYoutubeEmbed;
const IframeWrapper = styled_components_1.default.div `
width: 100%;
aspect-ratio: 16/9;
`;