From a0855ab2e27b2179488ea93321658dd655fcb54c Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Mon, 22 Jun 2026 23:56:25 +0000 Subject: [PATCH] Deploy Inicial do SteelCheck com Docker Build Automatizado --- components/PrintableReport.tsx | 112 +++------------------------------ components/ReportDisplay.tsx | 4 +- 2 files changed, 12 insertions(+), 104 deletions(-) diff --git a/components/PrintableReport.tsx b/components/PrintableReport.tsx index f7f59d9..699ea11 100644 --- a/components/PrintableReport.tsx +++ b/components/PrintableReport.tsx @@ -1,116 +1,24 @@ import React from 'react'; -import type { ReportData, ComplianceItem } from '../types'; +import type { ReportData } from '../types'; +import { ReportDisplay } from './ReportDisplay'; interface PrintableReportProps { report: ReportData; } -const formatDate = (dateString: string) => { - if (!dateString) return ''; - // Tries to parse common date formats like DD.MM.YYYY or YYYY-MM-DD - const parts = dateString.split(/[.\-/]/); - if (parts.length === 3) { - // Assuming DD.MM.YYYY - if (parts[0].length === 2) return `${parts[0]}/${parts[1]}/${parts[2]}`; - // Assuming YYYY-MM-DD - if (parts[0].length === 4) return `${parts[2]}/${parts[1]}/${parts[0]}`; - } - return dateString; // fallback -}; - -const TableRow: React.FC<{item: ComplianceItem}> = ({item}) => ( - - {item.property || item.element || item.test} - {item.norm} - {item.certificate} - {item.status} - -) - export const PrintableReport: React.FC = ({ report }) => { - const identification = report?.identification || {}; - const compliance = report?.compliance || { status: 'NÃO CONFORME', mechanical: [], chemical: [], otherTests: [] }; - const overPerformance = report?.overPerformance || []; - const equivalents = report?.equivalents || []; - const confidence = report?.confidence || 0; - const jsonData = JSON.stringify(report); - + // To ensure the generated PDF is strictly in light mode, we can wrap it in a container + // that forces light theme classes, but since html2canvas evaluates computed styles, + // it's best to ensure it renders offscreen without "dark" class in its hierarchy. + // The 'light' class can help if tailwind 'dark' strategy is class-based. return (
-
-
-

SteelBase

-

Análise de Qualidade Industrial com IA

-
-
-

Relatório de Análise Técnica

-

Documento gerado em: {new Date().toLocaleDateString('pt-BR')}

-
-
- -
-
-
Produto: {identification.product}
-
Norma Principal: {identification.standards}
-
Fabricante: {identification.manufacturer}
-
Nº Certificado: {identification.certificateNumber}
-
Lotes: {identification.batches}
-
Corridas: {identification.heats}
-
Quantidade: {identification.quantity}
-
Data Emissão: {formatDate(identification.certificateDate)}
-
- -
-

Resumo da Análise

-
-

O material de {identification.product} atende aos requisitos da norma {identification.standards}. Status Geral de Conformidade: {compliance.status}.

- {compliance.status === 'CONFORME' && overPerformance.length > 0 && ( -

O material excede os requisitos normativos em pontos-chave, como {overPerformance.map(item => item.property).join(', ')}.

- )} -
-
- -
-

Análise de Composição Química

- - - - - {compliance.chemical.map((item, i) => )} -
ElementoNormaCertificadoStatus
-
- -
-

Análise de Propriedades Mecânicas

- - - - - {compliance.mechanical.map((item, i) => )} -
PropriedadeNormaCertificadoStatus
-
- -
-

Normas Equivalentes

-
- {equivalents.map((item, i) => ( -
-

{item.system}

-

{item.norm}

-
- ))} -
-
-
- -
- Relatório gerado por SteelBase | Confiança da Análise: {confidence}% -
+
); }; \ No newline at end of file diff --git a/components/ReportDisplay.tsx b/components/ReportDisplay.tsx index 4527442..d254fd0 100644 --- a/components/ReportDisplay.tsx +++ b/components/ReportDisplay.tsx @@ -118,7 +118,7 @@ export const ReportDisplay: React.FC = ({ report }) => {
{/* Propriedades Mecânicas (Esquerda) */} -
+

2. Propriedades Mecânicas @@ -172,7 +172,7 @@ export const ReportDisplay: React.FC = ({ report }) => {

{/* Composição Química (Direita) */} -
+

3. Composição Química (%)