2022-08-11 04:33:29 +00:00
|
|
|
import { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
2022-12-20 21:07:34 +00:00
|
|
|
import clsx from 'clsx';
|
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>;
|
2022-01-04 12:16:09 +00:00
|
|
|
label: string;
|
2022-11-22 12:16:34 +00:00
|
|
|
description?: ReactNode;
|
2022-12-20 21:07:34 +00:00
|
|
|
className?: string;
|
2022-01-04 12:16:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function TableTitle({
|
|
|
|
icon,
|
|
|
|
label,
|
|
|
|
children,
|
2022-09-26 19:43:24 +00:00
|
|
|
description,
|
2022-12-20 21:07:34 +00:00
|
|
|
className,
|
2022-01-04 12:16:09 +00:00
|
|
|
}: PropsWithChildren<Props>) {
|
|
|
|
return (
|
2023-06-25 05:38:43 +00:00
|
|
|
<>
|
|
|
|
<div className={clsx('toolBar flex-col', className)}>
|
|
|
|
<div className="flex w-full items-center gap-1 p-0">
|
|
|
|
<div className="toolBarTitle">
|
|
|
|
{icon && (
|
|
|
|
<div className="widget-icon">
|
|
|
|
<Icon icon={icon} className="space-right" />
|
|
|
|
</div>
|
|
|
|
)}
|
2022-06-23 06:32:18 +00:00
|
|
|
|
2023-06-25 05:38:43 +00:00
|
|
|
{label}
|
|
|
|
</div>
|
|
|
|
{children}
|
2022-09-26 19:43:24 +00:00
|
|
|
</div>
|
2022-01-04 12:16:09 +00:00
|
|
|
</div>
|
2023-06-25 05:38:43 +00:00
|
|
|
{!!description && <div className="toolBar !pt-0">{description}</div>}
|
|
|
|
</>
|
2022-01-04 12:16:09 +00:00
|
|
|
);
|
|
|
|
}
|