refactor: standardize admin page shell

This commit is contained in:
hailin
2026-07-02 15:39:03 +08:00
parent 09df56c21b
commit 2a63f97f35
13 changed files with 65 additions and 52 deletions

View 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>
)
}