import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import { isReactServerComponentOrFunction } from 'payload/shared';
import React from 'react';
export const WithServerSideProps = ({ Component, serverOnlyProps, ...rest })=>{
    if (Component) {
        const WithServerSideProps = (passedProps)=>{
            const propsWithServerOnlyProps = {
                ...passedProps,
                ...isReactServerComponentOrFunction(Component) ? serverOnlyProps ?? {} : {}
            };
            return /*#__PURE__*/ _jsxDEV(Component, {
                ...propsWithServerOnlyProps
            }, void 0, false, {
                fileName: "src/elements/WithServerSideProps/index.tsx",
                lineNumber: 18,
                columnNumber: 14
            }, this);
        };
        return WithServerSideProps(rest);
    }
    return null;
};

//# sourceMappingURL=index.js.map