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 (
|
2022-12-20 21:07:34 +00:00
|
|
|
<div className={clsx('toolBar flex-col', className)}>
|
2023-02-12 21:04:24 +00:00
|
|
|
<div className="flex w-full items-center gap-1 p-0">
|
2022-09-26 19:43:24 +00:00
|
|
|
<div className="toolBarTitle">
|
|
|
|
{icon && (
|
|
|
|
<div className="widget-icon">
|
2022-11-28 02:00:28 +00:00
|
|
|
<Icon icon={icon} className="space-right" />
|
2022-09-26 19:43:24 +00:00
|
|
|
</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-11-22 12:16:34 +00:00
|
|
|
{description}
|
2022-01-04 12:16:09 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|