Spaces:
Build error
Build error
Upload components/Results.jsx with huggingface_hub
Browse files- components/Results.jsx +52 -27
components/Results.jsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
import { FiUser, FiBriefcase, FiMapPin, FiAlertCircle } from 'react-icons/fi';
|
| 2 |
|
| 3 |
export default function Results({ data, loading, error }) {
|
| 4 |
if (loading) {
|
| 5 |
return (
|
| 6 |
<div className="text-center py-8">
|
| 7 |
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"></div>
|
| 8 |
-
<p className="text-gray-600">Carregando dados...</p>
|
| 9 |
</div>
|
| 10 |
);
|
| 11 |
}
|
|
@@ -35,37 +35,62 @@ export default function Results({ data, loading, error }) {
|
|
| 35 |
}
|
| 36 |
|
| 37 |
return (
|
| 38 |
-
<div className="space-y-
|
| 39 |
{data.map((agent, index) => (
|
| 40 |
-
<div key={index} className="bg-white rounded-lg shadow-md
|
| 41 |
-
<div className="
|
| 42 |
-
<div className="flex
|
| 43 |
-
<div className="
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
</div>
|
| 46 |
-
<div>
|
| 47 |
-
<
|
| 48 |
-
<
|
| 49 |
-
</h3>
|
| 50 |
-
<p className="text-gray-600 flex items-center">
|
| 51 |
-
<FiBriefcase className="mr-2" /> {agent.position}
|
| 52 |
</p>
|
|
|
|
|
|
|
|
|
|
| 53 |
</div>
|
| 54 |
</div>
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
</div>
|
| 64 |
-
{agent.details && (
|
| 65 |
-
<div className="mt-4 pt-4 border-t border-gray-200">
|
| 66 |
-
<p className="text-gray-700">{agent.details}</p>
|
| 67 |
-
</div>
|
| 68 |
-
)}
|
| 69 |
</div>
|
| 70 |
))}
|
| 71 |
</div>
|
|
|
|
| 1 |
+
import { FiUser, FiBriefcase, FiMapPin, FiAlertCircle, FiBarChart2, FiFileText } from 'react-icons/fi';
|
| 2 |
|
| 3 |
export default function Results({ data, loading, error }) {
|
| 4 |
if (loading) {
|
| 5 |
return (
|
| 6 |
<div className="text-center py-8">
|
| 7 |
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"></div>
|
| 8 |
+
<p className="text-gray-600">Carregando dados e gerando análise...</p>
|
| 9 |
</div>
|
| 10 |
);
|
| 11 |
}
|
|
|
|
| 35 |
}
|
| 36 |
|
| 37 |
return (
|
| 38 |
+
<div className="space-y-6">
|
| 39 |
{data.map((agent, index) => (
|
| 40 |
+
<div key={index} className="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow">
|
| 41 |
+
<div className="p-6">
|
| 42 |
+
<div className="flex flex-col md:flex-row md:items-center md:justify-between">
|
| 43 |
+
<div className="flex items-center space-x-4 mb-4 md:mb-0">
|
| 44 |
+
<div className="bg-primary text-white rounded-full h-12 w-12 flex items-center justify-center font-bold text-xl">
|
| 45 |
+
{agent.name.charAt(0)}
|
| 46 |
+
</div>
|
| 47 |
+
<div>
|
| 48 |
+
<h3 className="text-lg font-semibold text-gray-900 flex items-center">
|
| 49 |
+
<FiUser className="mr-2" /> {agent.name}
|
| 50 |
+
</h3>
|
| 51 |
+
<p className="text-gray-600 flex items-center">
|
| 52 |
+
<FiBriefcase className="mr-2" /> {agent.position}
|
| 53 |
+
</p>
|
| 54 |
+
</div>
|
| 55 |
</div>
|
| 56 |
+
<div className="text-right">
|
| 57 |
+
<p className="text-gray-600 flex items-center justify-end md:justify-start">
|
| 58 |
+
<FiMapPin className="mr-2" /> {agent.location}
|
|
|
|
|
|
|
|
|
|
| 59 |
</p>
|
| 60 |
+
<span className={`inline-block px-2 py-1 rounded-full text-xs font-medium ${agent.status === 'ativo' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'}`}>
|
| 61 |
+
{agent.status}
|
| 62 |
+
</span>
|
| 63 |
</div>
|
| 64 |
</div>
|
| 65 |
+
|
| 66 |
+
{agent.details && (
|
| 67 |
+
<div className="mt-4 pt-4 border-t border-gray-200">
|
| 68 |
+
<p className="text-gray-700">{agent.details}</p>
|
| 69 |
+
</div>
|
| 70 |
+
)}
|
| 71 |
+
|
| 72 |
+
{agent.analysis && (
|
| 73 |
+
<div className="mt-4 pt-4 border-t border-gray-200">
|
| 74 |
+
<h4 className="font-medium text-gray-900 mb-2 flex items-center">
|
| 75 |
+
<FiBarChart2 className="mr-2" /> Análise Forense
|
| 76 |
+
</h4>
|
| 77 |
+
<p className="text-gray-700">{agent.analysis}</p>
|
| 78 |
+
</div>
|
| 79 |
+
)}
|
| 80 |
+
|
| 81 |
+
{agent.recommendations && (
|
| 82 |
+
<div className="mt-4 pt-4 border-t border-gray-200">
|
| 83 |
+
<h4 className="font-medium text-gray-900 mb-2 flex items-center">
|
| 84 |
+
<FiFileText className="mr-2" /> Recomendações
|
| 85 |
+
</h4>
|
| 86 |
+
<ul className="list-disc list-inside text-gray-700 space-y-1">
|
| 87 |
+
{agent.recommendations.map((rec, i) => (
|
| 88 |
+
<li key={i}>{rec}</li>
|
| 89 |
+
))}
|
| 90 |
+
</ul>
|
| 91 |
+
</div>
|
| 92 |
+
)}
|
| 93 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
</div>
|
| 95 |
))}
|
| 96 |
</div>
|