ConceptPortal-public/rsconcept/frontend/src/components/ui/IconValue.tsx

51 lines
997 B
TypeScript
Raw Normal View History

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 21:39:19 +03:00
className={clsx('flex items-center text-right', { 'justify-between gap-6': !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}
/>
2024-08-22 21:39:19 +03:00
<span id={id} className='min-w-[1.2rem]'>
{value}
</span>
2024-08-21 21:36:29 +03:00
</div>
);
}
export default IconValue;