完善账单页面,抽取公共页面组件

This commit is contained in:
2025-04-11 17:34:42 +08:00
parent 7238166a95
commit e0c75f9506
26 changed files with 542 additions and 84 deletions

21
src/components/page.tsx Normal file
View File

@@ -0,0 +1,21 @@
import {ComponentProps, ReactNode} from 'react'
import {merge} from '@/lib/utils'
export type PageProps = {
mode?: 'full' | 'blank'
}
export default function Page(props: ComponentProps<'main'> & PageProps) {
return (
<main {...props} className={merge(
`flex-auto flex gap-4`,
{
full: `bg-white rounded-tl-xl p-4 flex-col overflow-auto`,
blank: `items-stretch pb-4 pr-4 overflow-hidden`,
}[props.mode ?? 'full'],
props.className,
)}>
{props.children}
</main>
)
}