1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00
portainer/app/react/components/Widget/WidgetBody.tsx

24 lines
498 B
TypeScript

import clsx from 'clsx';
import { PropsWithChildren } from 'react';
import { useWidgetContext } from './Widget';
import { Loading } from './Loading';
interface Props {
loading?: boolean;
className?: string;
}
export function WidgetBody({
loading,
className,
children,
}: PropsWithChildren<Props>) {
useWidgetContext();
return (
<div className={clsx(className, 'widget-body')}>
{loading ? <Loading /> : <div className="widget-content">{children}</div>}
</div>
);
}