2022-08-11 04:33:29 +00:00
|
|
|
import { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
2022-01-04 12:16:09 +00:00
|
|
|
|
2022-08-11 04:33:29 +00:00
|
|
|
import { Icon } from '@@/Icon';
|
2022-06-23 06:32:18 +00:00
|
|
|
|
2022-08-11 04:33:29 +00:00
|
|
|
interface Props {
|
|
|
|
icon?: ReactNode | ComponentType<unknown>;
|
|
|
|
featherIcon?: boolean;
|
2022-01-04 12:16:09 +00:00
|
|
|
label: string;
|
2022-09-26 19:43:24 +00:00
|
|
|
description?: JSX.Element;
|
2022-01-04 12:16:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function TableTitle({
|
|
|
|
icon,
|
2022-06-23 06:32:18 +00:00
|
|
|
featherIcon,
|
2022-01-04 12:16:09 +00:00
|
|
|
label,
|
|
|
|
children,
|
2022-09-26 19:43:24 +00:00
|
|
|
description,
|
2022-01-04 12:16:09 +00:00
|
|
|
}: PropsWithChildren<Props>) {
|
|
|
|
return (
|
2022-09-26 19:43:24 +00:00
|
|
|
<div className="toolBar flex-col">
|
|
|
|
<div className="flex gap-1 p-0 w-full items-center">
|
|
|
|
<div className="toolBarTitle">
|
|
|
|
{icon && (
|
|
|
|
<div className="widget-icon">
|
|
|
|
<Icon
|
|
|
|
icon={icon}
|
|
|
|
feather={featherIcon}
|
|
|
|
className="space-right feather"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)}
|
2022-06-23 06:32:18 +00:00
|
|
|
|
2022-09-26 19:43:24 +00:00
|
|
|
{label}
|
|
|
|
</div>
|
|
|
|
{children}
|
2022-01-04 12:16:09 +00:00
|
|
|
</div>
|
2022-09-26 19:43:24 +00:00
|
|
|
{description && description}
|
2022-01-04 12:16:09 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|