Procházet zdrojové kódy

Merge branch '49-grados-dia-promedio' into develop

wilitp před 4 roky
rodič
revize
ca3766f006

+ 4 - 1
app/src/components/data/GeneralPerSector/index.tsx

@@ -59,6 +59,9 @@ const GeneralPerSector: FC = () => {
       >
         {x.grados_acumulados ?? "-"}
       </td>
+
+      <td className={classes.cell}>{x.grados_acumulados_promedio ?? "-"}</td>
+
       <td
         className={classes.cell}
         style={{
@@ -85,7 +88,7 @@ const GeneralPerSector: FC = () => {
   return (
     <>
       <table className={`${classes.table}`}>
-        <Header daysToMatchCurrentTemperature={false} />
+        <Header averageAccumulated />
         {/* Mostrar las filas si hay data */}
         <tbody>{data && rows}</tbody>
       </table>

+ 8 - 2
app/src/components/data/shared.tsx

@@ -11,11 +11,13 @@ import {
 
 interface tableHeaderProps {
   //Change this name
-  daysToMatchCurrentTemperature: boolean;
+  daysToMatchCurrentTemperature?: boolean;
+  averageAccumulated?: boolean;
 }
 
 export const TableHeader: FC<tableHeaderProps> = ({
-  daysToMatchCurrentTemperature,
+  daysToMatchCurrentTemperature = false,
+  averageAccumulated = false,
 }) => {
   return (
     <thead style={{ minHeight: "90px" }}>
@@ -62,6 +64,10 @@ export const TableHeader: FC<tableHeaderProps> = ({
         Grados días acumulados
       </td>
 
+      {averageAccumulated && (
+        <td className={classes.cell}>Grados dias promedio</td>
+      )}
+
       {daysToMatchCurrentTemperature && (
         <td className={classes.cell}>Días para igualar temporada actual</td>
       )}

+ 1 - 0
app/src/types/summary.ts

@@ -11,6 +11,7 @@ export interface Summary {
   gt30: number;
   gt33: number;
   grados_acumulados: number;
+  grados_acumulados_promedio: number;
   amplitud_termica: number;
   precip_acumulada: number;
   data_percentage: number;