2024-08-21 21:36:29 +03:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
|
|
|
import { CProps } from '../props';
|
|
|
|
import MiniButton from './MiniButton';
|
|
|
|
|
|
|
|
interface IconValueProps extends CProps.Styling, CProps.Titled {
|
|
|
|
id?: string;
|
|
|
|
icon: React.ReactNode;
|
|
|
|
value: string | number;
|
|
|
|
onClick?: (event: CProps.EventMouse) => void;
|
|
|
|
dense?: boolean;
|
|
|
|
disabled?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
function IconValue({
|
|
|
|
id,
|
|
|
|
dense,
|
|
|
|
value,
|
|
|
|
icon,
|
|
|
|
disabled = true,
|
|
|
|
title,
|
|
|
|
titleHtml,
|
|
|
|
hideTitle,
|
|
|
|
className,
|
|
|
|
onClick,
|
|
|
|
...restProps
|
|
|
|
}: IconValueProps) {
|
|
|
|
return (
|
|
|
|
<div
|
2024-08-22 15:30:01 +03:00
|
|
|
className={clsx('flex items-center', { 'justify-between gap-6 text-right': !dense, 'gap-1': dense }, className)}
|
2024-08-21 21:36:29 +03:00
|
|
|
{...restProps}
|
|
|
|
>
|
|
|
|
<MiniButton
|
|
|
|
noHover
|
|
|
|
noPadding
|
|
|
|
title={title}
|
|
|
|
titleHtml={titleHtml}
|
|
|
|
hideTitle={hideTitle}
|
|
|
|
icon={icon}
|
|
|
|
disabled={disabled}
|
|
|
|
onClick={onClick}
|
|
|
|
/>
|
|
|
|
<span id={id}>{value}</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default IconValue;
|