import React from 'react'; import { useBenchmarking } from '../../hooks/useBenchmarking'; import { CheckCircleIcon, XCircleIcon, FolderOpenIcon } from '@heroicons/react/24/solid'; export const BenchmarkingEscritorio: React.FC = () => { // Hook para buscar e calcular benchmarking const { data: benchmarking, isLoading, error } = useBenchmarking(); if (isLoading) return
Carregando benchmarking...
; if (error) return
Erro ao buscar benchmarking
; if (!benchmarking) return null; // Cálculo da porcentagem de sucesso das causas const totalCausas = benchmarking.procedentes + benchmarking.improcedentesOuSemMerito; const sucessoPercent = totalCausas > 0 ? Math.round((benchmarking.procedentes / totalCausas) * 100) : 0; return (
Total de processos
{benchmarking.totalProcessos}
Processos ativos
{benchmarking.ativos}
Julgados procedentes
{benchmarking.procedentes}
Improcedentes/Sem mérito
{benchmarking.improcedentesOuSemMerito}
% de sucesso das causas {sucessoPercent}%
); };