diff options
Diffstat (limited to 'src/components/templates/page/page-body.tsx')
| -rw-r--r-- | src/components/templates/page/page-body.tsx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/components/templates/page/page-body.tsx b/src/components/templates/page/page-body.tsx new file mode 100644 index 0000000..df69731 --- /dev/null +++ b/src/components/templates/page/page-body.tsx @@ -0,0 +1,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); |
