import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
// @ts-nocheck
import { Divider } from '$componentsDivider';
import { theme } from '$constantsTheme';
import { Body, Column, Container, Head, Html, Img, Preview, Link as ReactEmailLink, Text as ReactEmailText, Row, Section, } from '@react-email/components';
import * as React from 'react';
const { branding } = theme;
export function EmailLayout({ children, previewText, }) {
    const hasFooterLinks = branding.links.privacyPolicy ?? branding.links.termsOfService;
    return (_jsxs(Html, { children: [_jsx(Head, {}), previewText && _jsx(Preview, { children: previewText }), _jsx(Body, { style: styles.main, children: _jsxs(Container, { style: styles.container, children: [_jsx(Section, { style: styles.header, children: _jsxs(Row, { children: [branding.logoUrl && (_jsx(Column, { style: { width: `${branding.logoWidth + 8}px` }, children: _jsx(Img, { src: branding.logoUrl, width: branding.logoWidth, height: branding.logoHeight, alt: `${branding.name} Logo`, style: { borderRadius: '4px' } }) })), _jsx(Column, { children: _jsx(ReactEmailText, { style: styles.brandName, children: branding.name }) })] }) }), _jsx(Divider, { spacing: "sm", style: { margin: '0' } }), _jsx(Section, { style: styles.content, children: children }), _jsxs(Section, { style: styles.footer, children: [_jsxs(ReactEmailText, { style: styles.footerText, children: ["\u00A9 ", branding.footer.copyrightYear, " ", branding.footer.companyName, ". All rights reserved.", _jsx("br", {}), branding.footer.address] }), hasFooterLinks && (_jsxs(ReactEmailText, { style: { ...styles.footerText, marginTop: '20px' }, children: [branding.links.privacyPolicy && (_jsx(ReactEmailLink, { href: branding.links.privacyPolicy, style: styles.footerLink, children: "Privacy Policy" })), branding.links.privacyPolicy &&
                                            branding.links.termsOfService && (_jsx(_Fragment, { children: "\u00A0\u00A0\u2022\u00A0\u00A0" })), branding.links.termsOfService && (_jsx(ReactEmailLink, { href: branding.links.termsOfService, style: styles.footerLink, children: "Terms of Service" }))] }))] })] }) })] }));
}
const styles = {
    main: {
        backgroundColor: theme.colors.background,
        fontFamily: theme.fontFamily,
        padding: '40px 0',
    },
    container: {
        backgroundColor: theme.colors.card,
        borderRadius: theme.borderRadius,
        margin: '0 auto',
        width: '100%',
        maxWidth: '560px',
        borderTop: `5px solid ${theme.colors.primary}`,
        boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
        overflow: 'hidden',
    },
    header: {
        padding: '30px 40px 20px',
    },
    brandName: {
        fontSize: '18px',
        fontWeight: '700',
        color: theme.colors.foreground,
        margin: '0',
    },
    content: {
        padding: theme.spacing.sectionPadding,
    },
    footer: {
        backgroundColor: theme.colors.muted,
        padding: '30px 40px',
        textAlign: 'center',
    },
    footerText: {
        fontSize: '12px',
        color: theme.colors.mutedForeground,
        lineHeight: '1.5',
        margin: '4px 0',
    },
    footerLink: {
        color: theme.colors.mutedForeground,
        textDecoration: 'none',
    },
};
//# sourceMappingURL=layout.js.map