fix(web): BodyWrapper add init height class
This commit is contained in:
@@ -24,16 +24,17 @@ interface BodyWrapperProps {
|
||||
/** Whether to show loading state */
|
||||
loading?: boolean
|
||||
/** Whether the content is empty */
|
||||
empty: boolean
|
||||
empty: boolean;
|
||||
className?: string;
|
||||
}
|
||||
const BodyWrapper: FC<BodyWrapperProps> = ({ children, loading = false, empty }) => {
|
||||
const BodyWrapper: FC<BodyWrapperProps> = ({ children, loading = false, empty, className = 'rb:max-h-[calc(100%-48px)]!' }) => {
|
||||
// Show loading spinner while data is being fetched
|
||||
if (loading) {
|
||||
return <PageLoading />
|
||||
return <PageLoading className={className} />
|
||||
}
|
||||
// Show empty state when no data is available
|
||||
if (!loading && empty) {
|
||||
return <PageEmpty />
|
||||
return <PageEmpty className={className} />
|
||||
}
|
||||
// Render actual content when data is loaded and available
|
||||
return children
|
||||
|
||||
@@ -78,7 +78,7 @@ export default function UserMemory() {
|
||||
}, [search, data])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
<Form form={form}>
|
||||
<Row gutter={16} className="rb:mb-4">
|
||||
<Col span={8}>
|
||||
@@ -137,6 +137,6 @@ export default function UserMemory() {
|
||||
})}
|
||||
</Row>
|
||||
</BodyWrapper>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user