Portal/rsconcept/frontend/src/components/View/ValueStats.tsx

25 lines
600 B
TypeScript
Raw Normal View History

2025-02-20 20:22:05 +03:00
import { type Styling, type Titled } from '@/components/props';
2024-08-23 12:35:05 +03:00
2025-02-07 10:53:49 +03:00
import { ValueIcon } from './ValueIcon';
2024-08-23 12:35:05 +03:00
// characters - threshold for small labels - small font
const SMALL_THRESHOLD = 3;
2025-02-20 20:22:05 +03:00
interface ValueStatsProps extends Styling, Titled {
/** Id of the component. */
2024-08-23 12:35:05 +03:00
id: string;
/** Icon to display. */
2024-08-23 12:35:05 +03:00
icon: React.ReactNode;
/** Value to display. */
2024-08-23 12:35:05 +03:00
value: string | number;
}
/**
* Displays statistics value with an icon.
*/
2025-02-07 10:53:49 +03:00
export function ValueStats(props: ValueStatsProps) {
2025-03-10 16:01:40 +03:00
return <ValueIcon dense smallThreshold={SMALL_THRESHOLD} textClassName='min-w-5' {...props} />;
2024-08-23 12:35:05 +03:00
}