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;
|
2024-02-06 12:17:38 +13:00
|
|
|
id?: 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,
|
2024-02-06 12:17:38 +13:00
|
|
|
id,
|
2022-01-04 14:16:09 +02:00
|
|
|
}: PropsWithChildren<Props>) {
|
|
|
|
return (
|
2023-06-25 12:38:43 +07:00
|
|
|
<>
|
2024-02-06 12:17:38 +13:00
|
|
|
<div className={clsx('toolBar flex-col', className)} id={id}>
|
2023-06-25 12:38:43 +07:00
|
|
|
<div className="flex w-full items-center gap-1 p-0">
|
2024-02-19 16:37:26 +02:00
|
|
|
<h2 className="toolBarTitle m-0 text-2xl">
|
2023-06-25 12:38:43 +07:00
|
|
|
{icon && (
|
|
|
|
<div className="widget-icon">
|
|
|
|
<Icon icon={icon} className="space-right" />
|
|
|
|
</div>
|
|
|
|
)}
|
2022-06-23 09:32:18 +03:00
|
|
|
|
2023-06-25 12:38:43 +07:00
|
|
|
{label}
|
2024-02-19 16:37:26 +02:00
|
|
|
</h2>
|
2023-06-25 12:38:43 +07:00
|
|
|
{children}
|
2022-09-27 08:43:24 +13:00
|
|
|
</div>
|
2022-01-04 14:16:09 +02:00
|
|
|
</div>
|
2023-06-25 12:38:43 +07:00
|
|
|
{!!description && <div className="toolBar !pt-0">{description}</div>}
|
|
|
|
</>
|
2022-01-04 14:16:09 +02:00
|
|
|
);
|
|
|
|
}
|