import React from 'react'
import { LmCoreComponents } from '@CONFIG'
import RightDrawer from './RightDrawer'
import { MainContent } from './MainContent'
import { LmPageProps } from './pageTypes'
import { usePage } from '../provider/SettingsPageProvider'
import EmptyContent from './EmptyContent'
import { LmComponentRender } from '@LmComponentRender'
export function LmPage({ content }: LmPageProps): JSX.Element {
const page = usePage()
const currentContent = page || content
const body = currentContent?.body || []
const rightBody = currentContent?.right_body || []
if (page.component !== 'page') {
return (
)
}
if (!body.length) {
return
}
if (
currentContent.property?.includes('enable_parallax') ||
body.some((i) => i.component === 'section_parallax')
) {
return (
// eslint-disable-next-line
// @ts-ignore
// eslint-disable-next-line react/jsx-pascal-case
{rightBody.length > 0 && }
)
}
return (
// eslint-disable-next-line
// @ts-ignore
// eslint-disable-next-line react/jsx-pascal-case
<>
{rightBody.length > 0 && }
>
)
}