import React, { useEffect } from 'react';
import { st, classes } from './AnnouncementModalLayout.st.css.js';
import TextButton from '../TextButton';
import { dataHooks } from './constants';
import BaseModalLayout from '../BaseModalLayout';
import deprecationLog from '../utils/deprecationLog';
/** A layout for announcement modals, to be used inside a &lt;Modal /&gt; */
const AnnouncementModalLayout = ({ theme = 'standard', // TODO: add default value for skin once theme is removed
actionsSize = 'medium', ...propsWithoutDefaults }) => {
    const { className, children, footnoteSkin, ...restProps } = {
        theme,
        actionsSize,
        ...propsWithoutDefaults,
    };
    const skin = propsWithoutDefaults.skin || theme;
    useEffect(() => {
        if (theme) {
            deprecationLog('<AnnouncementModalLayout/> - prop "theme" is deprecated and will be removed in next major release, please use "skin" property instead.');
        }
    }, [theme]);
    return (React.createElement(BaseModalLayout, { className: st(classes.announcementModalLayout, className), ...restProps, skin: skin },
        React.createElement(BaseModalLayout.Illustration, null),
        React.createElement(BaseModalLayout.Header, { titleSize: "extraLarge" }),
        React.createElement(BaseModalLayout.Content, { hideTopScrollDivider: true, hideBottomScrollDivider: true }, children),
        React.createElement(BaseModalLayout.Footer, null),
        React.createElement(Link, { ...restProps, skin: skin }),
        React.createElement("div", { className: classes.bottomSpacing }),
        React.createElement(BaseModalLayout.Footnote, { skin: footnoteSkin })));
};
const Link = ({ linkText, linkOnClick, skin, }) => ((linkText || linkOnClick) && (React.createElement("div", { className: classes.link },
    React.createElement(TextButton, { size: "small", weight: "normal", dataHook: dataHooks.link, onClick: linkOnClick, skin: skin }, linkText)))) ||
    null;
AnnouncementModalLayout.displayName = 'AnnouncementModalLayout';
export default AnnouncementModalLayout;
//# sourceMappingURL=AnnouncementModalLayout.js.map