feat: Add base project structure with API and web components
This commit is contained in:
19
web/src/components/Empty/BodyWrapper.tsx
Normal file
19
web/src/components/Empty/BodyWrapper.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { FC, ReactNode } from 'react'
|
||||
import { Skeleton } from 'antd'
|
||||
import Empty from './index'
|
||||
|
||||
interface BodyWrapperProps {
|
||||
children: ReactNode
|
||||
loading?: boolean
|
||||
empty: boolean
|
||||
}
|
||||
const BodyWrapper: FC<BodyWrapperProps> = ({ children, loading = false, empty }) => {
|
||||
if (loading) {
|
||||
return <Skeleton active />
|
||||
}
|
||||
if (!loading && empty) {
|
||||
return <Empty />
|
||||
}
|
||||
return children
|
||||
}
|
||||
export default BodyWrapper
|
||||
Reference in New Issue
Block a user