import React, {PropsWithChildren, ReactElement} from 'react'; import SkeletonTitle from "../skeleton/SkeletonTitle"; import SkeletonParagraph from "../skeleton/SkeletonParagraph"; import StatusIndicator, {StatusType} from "../StatusIndicator"; export interface StatusCardSkeletonData { loading?: boolean header?: string title?: string subtitle?: string subtitleRight?: string | ReactElement status?: string statusType?: StatusType } const StatusCardSkeleton = (props: PropsWithChildren) => { const { loading, header, status = null, statusType, title, subtitle, subtitleRight, children } = props || {}; const showLoading = loading || (header === undefined && title === undefined); return (
{header ?
{header}
: null} {title ?
{title}
: null} {subtitle ?
{subtitle}
: null}
{status}
{subtitleRight ?
{subtitleRight}
: null}
{loading ? : children}
); } export default StatusCardSkeleton;