-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathInfoBox.tsx
47 lines (43 loc) · 1.37 KB
/
InfoBox.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React from "react";
interface InfoBoxProps {
title: string; // Define the title prop
width?: string; // Optional width prop for customization
}
const InfoBox: React.FC<InfoBoxProps> = ({ title, width = "16rem" }) => {
return (
<div
className="bg-gray-800 text-white rounded-lg shadow-md p-6 h-40 flex flex-col justify-between hover:scale-105 transform transition-transform"
style={{
borderRadius: "10px",
boxShadow: "0 4px 10px rgba(0, 0, 0, 0.3)",
margin: "20px",
width, // Apply dynamic width
height: '150px'
}}
>
{/* Title */}
<div
className="text-lg font-bold text-center"
style={{ textAlign: "center", margin: "10px" }}
>
{title}
</div>
{/* Content */}
<div className="flex flex-col space-y-2">
<div className="flex justify-between text-sm">
<span>Metric 1:</span>
<span className="font-medium text-green-400">123</span>
</div>
<div className="flex justify-between text-sm">
<span>Metric 2:</span>
<span className="font-medium text-red-400">45%</span>
</div>
<div className="flex justify-between text-sm">
<span>Metric 3:</span>
<span className="font-medium text-yellow-400">12</span>
</div>
</div>
</div>
);
};
export default InfoBox;