Spaces:
Sleeping
Sleeping
File size: 752 Bytes
1af45d7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import React, { FC } from 'react';
interface Props {
title: string;
value: number | string;
description: string;
colorHex: string;
subtitle?: string;
}
const MetricCard: FC<Props> = ({ title, value, description, colorHex, subtitle }) => (
<div
className="bg-white rounded-xl shadow-lg p-6 transition-shadow hover:shadow-xl"
style={{ borderLeft: `4px solid ${colorHex}` }}
>
<h3 className="text-lg font-semibold text-gray-800 mb-1">{title}</h3>
{subtitle && <p className="text-xs text-gray-500 mb-2">{subtitle}</p>}
<div className="text-3xl font-bold mb-2">{typeof value === 'number' ? value.toFixed(3) : value}</div>
<p className="text-sm text-gray-600">{description}</p>
</div>
);
export default MetricCard;
|