11/**
2- * Copyright IBM Corp. 2025
2+ * Copyright IBM Corp. 2025, 2026
33 *
44 * This source code is licensed under the Apache-2.0 license found in the
55 * LICENSE file in the root directory of this source tree.
@@ -10,30 +10,32 @@ import { Children, Suspense } from 'react';
1010import { Nav } from '../components/nav/Nav' ;
1111import classNames from 'classnames' ;
1212
13- export const PageLayout = ( { children, className, fallback } ) => {
14- const childArray = Children . toArray ( children ) ;
15- const otherChildren = childArray . filter (
16- ( child ) => child . type !== PageLayoutHeader ,
17- ) ;
18- const Header = childArray . find ( ( child ) => child . type === PageLayoutHeader ) ;
13+ /**
14+ * PageLayout component provides a consistent layout structure for pages in the application.
15+ * It includes the navigation component and wraps content in Carbon's Content component.
16+ *
17+ * @component
18+ * @param {Object } props - Component props
19+ * @param {React.ReactNode } props.children - Child components to render within the layout
20+ * @param {string } [props.className] - Additional CSS class names to apply to the layout container
21+ * @param {React.ReactNode } [props.fallback] - Fallback content to display while Suspense is loading
22+ *
23+ * @example
24+ * <PageLayout>
25+ * <h1>Page Content</h1>
26+ * </PageLayout>
27+ *
28+ */
1929
30+ export const PageLayout = ( { children, className, fallback } ) => {
2031 return (
2132 < Suspense fallback = { fallback } >
2233 < div className = { classNames ( 'cs--page-layout' , className ) } >
2334 < Nav />
24- < Content className = "cs--content" >
25- < div className = "cs--page-layout__content" >
26- { Header }
27- < div className = "cs--page-layout__content-body" > { otherChildren } </ div >
28- </ div >
35+ < Content className = "cs--content cs--page-layout__content" >
36+ { children }
2937 </ Content >
3038 </ div >
3139 </ Suspense >
3240 ) ;
3341} ;
34-
35- const PageLayoutHeader = ( { children } ) => (
36- < div className = "cs--page-layout__content-header" > { children } </ div >
37- ) ;
38- PageLayoutHeader . displayName = 'PageLayoutHeader' ;
39- PageLayout . Header = PageLayoutHeader ;
0 commit comments