refactor: standardize admin page shell
This commit is contained in:
25
frontend/src/components/app/AppPage.tsx
Normal file
25
frontend/src/components/app/AppPage.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import type * as React from 'react'
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
type AppPageProps = {
|
||||
children: React.ReactNode
|
||||
className?: string
|
||||
contentClassName?: string
|
||||
maxWidth?: '6xl' | '7xl'
|
||||
}
|
||||
|
||||
const maxWidthClass: Record<NonNullable<AppPageProps['maxWidth']>, string> = {
|
||||
'6xl': 'max-w-6xl',
|
||||
'7xl': 'max-w-7xl'
|
||||
}
|
||||
|
||||
export function AppPage({ children, className, contentClassName, maxWidth = '7xl' }: AppPageProps) {
|
||||
return (
|
||||
<main className={cn('min-h-screen bg-background px-4 py-4 text-foreground sm:px-6 lg:py-6', className)}>
|
||||
<div className={cn('mx-auto flex flex-col gap-4', maxWidthClass[maxWidth], contentClassName)}>
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user