import React from 'react'; import { AdhesionGradeSelect } from '../AdhesionGradeSelect'; import { Input } from '../Input'; import { Select } from '../Select'; import { Droplets, Thermometer, Sun } from 'lucide-react'; interface PaintingFormData { epsPoints: string[]; adhesionTest: string; batch?: string; treatmentExecutor?: string; stockItemId?: string; temperature?: string; relativeHumidity?: string; period?: string; partTemperature?: string; treatmentType?: string; roughnessReadings?: string[]; } interface PaintingInspectionFormProps { formData: PaintingFormData; handleChange: (e: React.ChangeEvent) => void; handleEpsChange: (index: number, value: string) => void; numericPoints: number[]; stockItems?: any[]; // Using any because StockItem might need to be imported or loosely typed here handleRoughnessChange: (index: number, value: string) => void; } export const PaintingInspectionForm: React.FC = ({ formData, handleChange, handleEpsChange, numericPoints, stockItems = [], handleRoughnessChange }) => { const minEps = numericPoints.length > 0 ? Math.min(...numericPoints) : 0; const maxEps = numericPoints.length > 0 ? Math.max(...numericPoints) : 0; const avgEps = numericPoints.length > 0 ? numericPoints.reduce((a, b) => a + b, 0) / numericPoints.length : 0; return (
{/* Batch and Executor Section */}
{formData.epsPoints.map((point: string, index: number) => (
{index + 1} handleEpsChange(index, e.target.value)} placeholder="µm" />
))}
Mínimo {minEps.toFixed(0)} µm
Máximo {maxEps.toFixed(0)} µm
Média Geral {avgEps.toFixed(1)} µm
handleRoughnessChange(i, e.target.value)} /> ))}
{/* Environmental Conditions */}
Condições Ambientais
{numericPoints.length < 10 && numericPoints.length > 0 && (

Preencha ao menos 10 medições para registrar.

)}
); };