-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.tsx
More file actions
32 lines (30 loc) · 834 Bytes
/
Copy pathlayout.tsx
File metadata and controls
32 lines (30 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* eslint-disable @typescript-eslint/no-explicit-any */
// import-slot
// end-import-slot
const Layout = (props: any) => {
if (!props) return <></>;
const { children, layoutComps, page } = props;
return (
//content-slot
<div className="test">
{/* section-slot */}
<div className="layout">
{page &&
layoutComps.length > 0 &&
layoutComps.map((Section: any, i: number) => {
return (
<div key={i}>
<Section content={page.layout.sections[i].content} />
{i === page.layout.contentIndex - 1 && (
<main id="main">{children}</main>
)}
</div>
);
})}
</div>
{/* end-section-slot */}
</div>
// end-content-slot
);
};
export default Layout;