ConceptPortal-public/rsconcept/frontend/src/components/ui/ValueLabeled.tsx
Ivan c1f50d6f50
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
D: Improve TSDocs for frontend components
2024-11-21 15:09:51 +03:00

32 lines
666 B
TypeScript

import clsx from 'clsx';
import { CProps } from '../props';
interface ValueLabeledProps extends CProps.Styling {
/** Id of the component. */
id?: string;
/** Label to display. */
label: string;
/** Value to display. */
text: string | number;
/** Tooltip for the component. */
title?: string;
}
/**
* Displays a labeled value.
*/
function ValueLabeled({ id, label, text, title, className, ...restProps }: ValueLabeledProps) {
return (
<div className={clsx('flex justify-between gap-6', className)} {...restProps}>
<span title={title}>{label}</span>
<span id={id}>{text}</span>
</div>
);
}
export default ValueLabeled;