// (C) 2022-2026 GoodData Corporation
import { useDashboardCustomizationsContext } from "./DashboardCustomizationsContext.js";
export const DEFAULT_SLIDE_WIDTH = 1920;
export const DEFAULT_SLIDE_HEIGHT = 1080;
export function useSlideData(renderMode) {
    const { slideConfig } = useDashboardCustomizationsContext();
    if (renderMode !== "export") {
        return undefined;
    }
    return {
        slideWidth: slideConfig?.width ?? DEFAULT_SLIDE_WIDTH,
        slideHeight: slideConfig?.height ?? DEFAULT_SLIDE_HEIGHT,
    };
}
export function useSlideSizeStyle(renderMode, type, parentLayoutPath) {
    const data = useSlideData(renderMode);
    if (!data) {
        return {};
    }
    if (type === "root") {
        return {
            width: `${data.slideWidth}px`,
        };
    }
    if (type === "section") {
        return parentLayoutPath && parentLayoutPath.length > 0
            ? {
                gridTemplateRows: "max-content",
                height: "100%",
            }
            : {
                height: `${data.slideHeight}px`,
                overflow: "hidden",
            };
    }
    return {
        height: "100%",
    };
}
//# sourceMappingURL=useSlideData.js.map