KOOHAWN/AI_PDF_TOOLKIt
0
1import type { ComponentPropsWithoutRef, ReactNode } from 'react';2import type { LayoutMode } from '../../app/layoutMode';3import { cn } from '../../lib/utils';4 5type ContentFrameProps = ComponentPropsWithoutRef<'main'> & {6 mode: LayoutMode;7 edgeToEdge?: boolean;8 children: ReactNode;9};10 11const modeClassNames: Record<LayoutMode, string> = {12 home: 'h-dvh bg-app p-0',13 form: 'mx-auto w-full max-w-[920px] gap-5 px-6 py-8 md:px-8',14 studio: 'h-[calc(100dvh-var(--header-height))] overflow-hidden bg-app p-4',15};16 17export function ContentFrame({ mode, edgeToEdge = false, className, children, ...props }: ContentFrameProps) {18 return (19 <main20 className={cn(21 'flex min-h-0 min-w-0 flex-grow flex-col transition-all duration-200',22 modeClassNames[mode],23 edgeToEdge && 'max-w-none p-0',24 className25 )}26 {...props}27 >28 {children}29 </main>30 );31}32 