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/datatables/TableTitle.tsx

42 lines
940 B

import { ComponentType, PropsWithChildren, ReactNode } from 'react';
import clsx from 'clsx';
import { Icon } from '@@/Icon';
interface Props {
icon?: ReactNode | ComponentType<unknown>;
label: string;
description?: ReactNode;
className?: string;
id?: string;
}
export function TableTitle({
icon,
label,
children,
description,
className,
id,
}: PropsWithChildren<Props>) {
return (
<>
<div className={clsx('toolBar flex-col', className)} id={id}>
<div className="flex w-full items-center gap-1 p-0">
<h2 className="toolBarTitle m-0 text-base">
{icon && (
<div className="widget-icon">
<Icon icon={icon} className="space-right" />
</div>
)}
{label}
</h2>
{children}
</div>
</div>
{!!description && <div className="toolBar !pt-0">{description}</div>}
</>
);
}