import { FC, memo } from 'react'
import { CardHeader } from '@app/components/stateless/card/header'
import { ListSkeleton, TextSkeleton } from '../../placeholders'
import { Button } from '../buttons'
import { UserManager } from '@app/managers'
const emptyClass = 'min-h-10'
const onLogout = () => {
UserManager.clearUser()
window.location.href = '/'
}
const SingleList = () => {
return (
)
}
// list wrapper to display loading and error page
const InnerWrapperComponent: FC = (props) => {
const {
loading,
data,
children,
error,
emptyHeaderTitle,
emptyHeaderSubTitle,
avatar = false,
small,
count,
full,
} = props
// Loading
if (!data && loading) {
if (full) {
// basic fullscreen loader
return
}
if (small) {
return (
<>
{Array.from(Array(count || 10).keys()).map(
(item: string | number) => (
)
)}
>
)
}
return
}
// ERROR PAGE to display errors ( not actual network error )
if (!data && !loading && error) {
return (
)
}
// render list content
if (data) {
return children
}
return (
)
}
export const InnerWrapper = memo(InnerWrapperComponent)