Spaces:
Build error
Build error
Upload components/ResourceDisplay.jsx with huggingface_hub
Browse files
components/ResourceDisplay.jsx
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { motion } from 'framer-motion';
|
| 2 |
+
|
| 3 |
+
export default function ResourceDisplay({ resources }) {
|
| 4 |
+
return (
|
| 5 |
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
|
| 6 |
+
{resources.map((resource) => (
|
| 7 |
+
<motion.div
|
| 8 |
+
key={resource.name}
|
| 9 |
+
whileHover={{ scale: 1.05 }}
|
| 10 |
+
className="bg-space-dark/50 border border-space-blue/30 rounded-lg p-4 text-center"
|
| 11 |
+
>
|
| 12 |
+
<div className="flex justify-center mb-2">
|
| 13 |
+
<resource.icon className="text-space-gold" size={32} />
|
| 14 |
+
</div>
|
| 15 |
+
<h3 className="text-lg font-semibold text-space-gold mb-1">{resource.name}</h3>
|
| 16 |
+
<p className="text-space-blue/80">{resource.amount.toLocaleString()}</p>
|
| 17 |
+
<p className="text-xs text-space-blue/60 mt-1">
|
| 18 |
+
+{resource.perSecond.toFixed(1)}/s
|
| 19 |
+
</p>
|
| 20 |
+
</motion.div>
|
| 21 |
+
))}
|
| 22 |
+
</div>
|
| 23 |
+
);
|
| 24 |
+
}
|