1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00
portainer/app/react/components/datatables/TableTitle.tsx
Chaim Lev-Ari bed4257194
refactor(containers): migrate view to react [EE-2212] (#6577)
Co-authored-by: LP B <xAt0mZ@users.noreply.github.com>
2022-08-11 07:33:29 +03:00

39 lines
761 B
TypeScript

import { ComponentType, PropsWithChildren, ReactNode } from 'react';
import { Icon } from '@@/Icon';
import { useTableContext } from './TableContainer';
interface Props {
icon?: ReactNode | ComponentType<unknown>;
featherIcon?: boolean;
label: string;
}
export function TableTitle({
icon,
featherIcon,
label,
children,
}: PropsWithChildren<Props>) {
useTableContext();
return (
<div className="toolBar">
<div className="toolBarTitle">
{icon && (
<div className="widget-icon">
<Icon
icon={icon}
feather={featherIcon}
className="space-right feather"
/>
</div>
)}
{label}
</div>
{children}
</div>
);
}