2022-06-23 06:32:18 +00:00
|
|
|
import { ReactNode } from 'react';
|
|
|
|
|
|
|
|
import { Icon, IconProps } from '@/react/components/Icon';
|
|
|
|
|
2022-06-17 16:18:42 +00:00
|
|
|
import { Widget, WidgetBody } from '@@/Widget';
|
2022-02-24 23:22:56 +00:00
|
|
|
|
2022-06-23 06:32:18 +00:00
|
|
|
interface Props extends IconProps {
|
|
|
|
value?: number;
|
2022-02-24 23:22:56 +00:00
|
|
|
type: string;
|
2022-06-23 06:32:18 +00:00
|
|
|
children?: ReactNode;
|
2022-02-24 23:22:56 +00:00
|
|
|
}
|
|
|
|
|
2022-06-23 06:32:18 +00:00
|
|
|
export function DashboardItem({
|
|
|
|
value,
|
|
|
|
icon,
|
|
|
|
type,
|
|
|
|
children,
|
|
|
|
featherIcon,
|
|
|
|
}: Props) {
|
2022-02-24 23:22:56 +00:00
|
|
|
return (
|
|
|
|
<div className="col-sm-12 col-md-6" aria-label={type}>
|
|
|
|
<Widget>
|
|
|
|
<WidgetBody>
|
|
|
|
<div className="widget-icon blue pull-left">
|
2022-06-23 06:32:18 +00:00
|
|
|
<Icon icon={icon} feather={featherIcon} />
|
2022-02-24 23:22:56 +00:00
|
|
|
</div>
|
2022-06-23 06:32:18 +00:00
|
|
|
<div className="pull-right">{children}</div>
|
2022-02-24 23:22:56 +00:00
|
|
|
<div className="title" aria-label="value">
|
|
|
|
{value}
|
|
|
|
</div>
|
|
|
|
<div className="comment" aria-label="resourceType">
|
|
|
|
{type}
|
|
|
|
</div>
|
|
|
|
</WidgetBody>
|
|
|
|
</Widget>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|