blob: df69731fde3bf68437c5c0889009f7fe8cf30170 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import {
type ForwardRefRenderFunction,
type HTMLAttributes,
forwardRef,
} from 'react';
import styles from './page.module.scss';
export type PageBodyProps = HTMLAttributes<HTMLDivElement>;
const PageBodyWithRef: ForwardRefRenderFunction<
HTMLDivElement,
PageBodyProps
> = ({ children, className = '', ...props }, ref) => {
const bodyClass = `${styles.body} ${className}`;
return (
<div {...props} className={bodyClass} ref={ref}>
{children}
</div>
);
};
export const PageBody = forwardRef(PageBodyWithRef);
|