Created
March 21, 2024 12:25
-
-
Save onesamket/9e6ce55cc9fce5aa76330d43af29053e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ComponentProps, forwardRef } from 'react' | |
import { twMerge } from 'tailwind-merge' | |
export const RootLayout = ({ children, className, ...props }: ComponentProps<'main'>) => { | |
return ( | |
<main className={twMerge('flex flex-row h-screen', className)} {...props}> | |
{children} | |
</main> | |
) | |
} | |
export const Sidebar = ({ className, children, ...props }: ComponentProps<'aside'>) => { | |
return ( | |
<aside | |
className={twMerge('w-[250px] mt-10 h-[100vh + 10px] overflow-auto', className)} | |
{...props} | |
> | |
{children} | |
</aside> | |
) | |
} | |
export const Content = forwardRef<HTMLDivElement, ComponentProps<'div'>>( | |
({ children, className, ...props }, ref) => ( | |
<div ref={ref} className={twMerge('flex-1 overflow-auto', className)} {...props}> | |
{children} | |
</div> | |
) | |
) | |
Content.displayName = 'Content' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment