Portal/rsconcept/frontend/src/components/view1/ValueLabeled.tsx

30 lines
652 B
TypeScript
Raw Normal View History

2024-06-07 20:17:03 +03:00
import clsx from 'clsx';
2025-02-20 20:22:05 +03:00
import { type Styling } from '@/components/props';
2024-06-07 20:17:03 +03:00
2025-02-20 20:22:05 +03:00
interface ValueLabeledProps extends Styling {
/** Id of the component. */
2024-06-07 20:17:03 +03:00
id?: string;
/** Label to display. */
2024-06-07 20:17:03 +03:00
label: string;
/** Value to display. */
2024-06-07 20:17:03 +03:00
text: string | number;
/** Tooltip for the component. */
2024-06-07 20:17:03 +03:00
title?: string;
}
/**
* Displays a labeled value.
*/
2025-02-07 10:53:49 +03:00
export function ValueLabeled({ id, label, text, title, className, ...restProps }: ValueLabeledProps) {
2024-06-07 20:17:03 +03:00
return (
<div className={clsx('flex justify-between gap-6', className)} {...restProps}>
<span title={title}>{label}</span>
<span id={id}>{text}</span>
</div>
);
}