2022-08-11 07:33:29 +03:00
|
|
|
import { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
2022-12-20 23:07:34 +02:00
|
|
|
import clsx from 'clsx';
|
2022-01-04 14:16:09 +02:00
|
|
|
|
2022-08-11 07:33:29 +03:00
|
|
|
import { Icon } from '@@/Icon';
|
2022-06-23 09:32:18 +03:00
|
|
|
|
2022-08-11 07:33:29 +03:00
|
|
|
interface Props {
|
|
|
|
icon?: ReactNode | ComponentType<unknown>;
|
2022-01-04 14:16:09 +02:00
|
|
|
label: string;
|
2022-11-22 14:16:34 +02:00
|
|
|
description?: ReactNode;
|
2022-12-20 23:07:34 +02:00
|
|
|
className?: string;
|
2022-01-04 14:16:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function TableTitle({
|
|
|
|
icon,
|
|
|
|
label,
|
|
|
|
children,
|
2022-09-27 08:43:24 +13:00
|
|
|
description,
|
2022-12-20 23:07:34 +02:00
|
|
|
className,
|
2022-01-04 14:16:09 +02:00
|
|
|
}: PropsWithChildren<Props>) {
|
|
|
|
return (
|
2022-12-20 23:07:34 +02:00
|
|
|
<div className={clsx('toolBar flex-col', className)}>
|
2023-02-13 10:04:24 +13:00
|
|
|
<div className="flex w-full items-center gap-1 p-0">
|
2022-09-27 08:43:24 +13:00
|
|
|
<div className="toolBarTitle">
|
|
|
|
{icon && (
|
|
|
|
<div className="widget-icon">
|
2022-11-28 15:00:28 +13:00
|
|
|
<Icon icon={icon} className="space-right" />
|
2022-09-27 08:43:24 +13:00
|
|
|
</div>
|
|
|
|
)}
|
2022-06-23 09:32:18 +03:00
|
|
|
|
2022-09-27 08:43:24 +13:00
|
|
|
{label}
|
|
|
|
</div>
|
|
|
|
{children}
|
2022-01-04 14:16:09 +02:00
|
|
|
</div>
|
2022-11-22 14:16:34 +02:00
|
|
|
{description}
|
2022-01-04 14:16:09 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|