You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/Widget/WidgetTitle.tsx

36 lines
818 B

import clsx from 'clsx';
import { PropsWithChildren, ReactNode } from 'react';
import { Icon } from '@/react/components/Icon';
import { useWidgetContext } from './Widget';
interface Props {
title: ReactNode;
icon: ReactNode;
className?: string;
}
export function WidgetTitle({
title,
icon,
className,
children,
}: PropsWithChildren<Props>) {
useWidgetContext();
return (
<div className="widget-header">
<div className="row">
<span className={clsx('pull-left vertical-center', className)}>
<div className="widget-icon">
<Icon icon={icon} className="space-right" />
</div>
<h2 className="text-base m-0">{title}</h2>
</span>
<span className={clsx('pull-right', className)}>{children}</span>
</div>
</div>
);
}