'use client';

import * as React from 'react';
import { Page as PDFPage, View as PDFView, Text as PDFText, StyleSheet } from '@react-pdf/renderer';
import { Header, Footer, pdfStyles, BlueprintBackground } from './SharedUI';

const simpleStyles = StyleSheet.create({
    industrialPage: {
        padding: 40,
        backgroundColor: '#ffffff',
    },
    industrialNumber: {
        fontSize: 60,
        fontWeight: 'bold',
        color: '#f1f5f9',
        position: 'absolute',
        top: -10,
        right: 0,
        zIndex: -1,
    },
    industrialSection: {
        marginTop: 32,
        paddingTop: 24,
        flexDirection: 'row',
        position: 'relative',
    },
});

interface SimpleLayoutProps {
    children: React.ReactNode;
    pageNumber?: string;
    icon?: string;
    footerLogo?: string;
    companyData: any;
    bankData: any;
    showPageNumber?: boolean;
}

export const SimpleLayout = ({
    children,
    pageNumber,
    icon,
    footerLogo,
    companyData,
    bankData,
    showPageNumber = true
}: SimpleLayoutProps) => {
    return (
        <PDFPage size="A4" style={[pdfStyles.page, simpleStyles.industrialPage]}>
            <BlueprintBackground />
            <Header icon={icon} showAddress={false} />
            {pageNumber && <PDFText style={simpleStyles.industrialNumber}>{pageNumber}</PDFText>}
            <PDFView style={simpleStyles.industrialSection}>
                <PDFView style={{ width: '100%' }}>
                    {children}
                </PDFView>
            </PDFView>
            <Footer
                logo={footerLogo}
                companyData={companyData}
                bankData={bankData}
                showDetails={false}
                showPageNumber={showPageNumber}
            />
        </PDFPage>
    );
};
