spectatr-player-sdk
Version:
A custom video player built with Stencil with Shaka Player integration
14 lines (13 loc) • 950 B
JavaScript
import { h } from "@stencil/core";
export function renderStatsModal(component, onClose) {
if (!component.currentStatistics)
return null;
const position = component.currentStatistics?.position ?? 'center';
const contentJustifyItem = position.includes('right') ? 'end' : position.includes('left') ? 'start' : 'center';
const contentAlignItem = position.includes('top') ? 'self-start' : 'self-end';
const closeModal = () => {
onClose();
};
return (h("div", { class: "stats-overlay", style: { justifyContent: contentJustifyItem, alignItems: contentAlignItem } }, h("div", { class: "stats-modal" }, h("div", null, h("button", { class: "stat-close-btn", onClick: closeModal }, "\u00D7")), h("div", { onClick: () => component.analyticsTracker.trackStatsClick(component.currentStatistics), class: "stats-content", innerHTML: component.currentStatistics.htmlString }))));
}
//# sourceMappingURL=stats-render.js.map