
<script lang="ts">
    import { A10BerechnungWaermequellenAnlagentechnikTrinkwarmwasser} from "#lib/Berechnungen/BedarfsausweisWohnen/A10BerechnungWaermequellenAnlagentechnikTrinkwarmwasser.js";
 
   $: result = A10BerechnungWaermequellenAnlagentechnikTrinkwarmwasser();
 
 </script>


<div class="overflow-x-auto mt-16">
    <table class="table-auto border-collapse border border-gray-300 w-full text-sm">
      <!-- Tabellenkopf -->
      <thead>
        <tr class="bg-gray-200 text-left">
          <th colspan="4" class="border border-gray-300 p-2">
            <h2>Tabelle A.10 — Trinkwassererwärmung – Berechnung der monatlichen Wärmequellen aus Anlagentechnik Trinkwassererwärmung</h2>
          </th>
        </tr>
        <th class="border border-gray-300 px-4 py-2">Monat</th>
        <th class="border border-gray-300 px-4 py-2">
          Tage im Monat<br>
          d<sub>mth</sub> [d] (1)
        </th>
        <th class="border border-gray-300 px-4 py-2">
          Trinkwasserwärmebedarf<br>
          Q<sub>w,b</sub> [kWh] aus Tabelle A.9<br>
          (2)
        </th>
        <th class="border border-gray-300 px-4 py-2">
          Wärmequellen Anlagentechnik<br>
          Q<sub>l,source,w</sub> =  Q<sub>w,b</sub> · f<sub>A-w</sub> [kWh]<br>
          (4) = (2) · (3)
        </th>
        <tr class="text-center">
          <th colspan="3" class="border border-gray-300 p-2"></th>
          <th colspan="1" class="border border-gray-300 p-2"> (3) = f<sub>A-w</sub><br>aus Tabelle 142 bzw. Tabelle 143</th>
          <tr class="text-center h-10">
            <th colspan="3" class="border border-gray-300 p-2"></th>
            <th colspan="1" class="border border-gray-300 p-2 bg-blue-100">{result.FaktorNutzbareWaermeTrinkwarmwasser}</th>
          </tr>
      </thead>
  
      <!-- Tabellenkörper -->
      <tbody>
        <!-- Monatszeilen -->
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Januar</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Januar)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Januar)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Februar</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">28</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Februar)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Februar)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">März</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Maerz)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Maerz)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">April</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">30</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.April)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.April)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Mai</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Mai)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Mai)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Juni</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">30</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Juni)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Juni)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Juli</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Juli)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Juli)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">August</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.August)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.August)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">September</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">30</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.September)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.September)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Oktober</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Oktober)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Oktober)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">November</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">30</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.November)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.November)}</td>
        </tr>
        <tr>
          <td class="w-1/4 border border-gray-300 p-2 text-center">Dezember</td>
          <td class="w-1/4 border border-gray-300 p-2 text-center bg-gray-100">31</td>
          <td class="border border-gray-300 p-2 text-center bg-yellow-100">{Math.round(result.trinkwasserWaermebedarf.Dezember)}</td>
          <td class="border-2 border-gray-600 p-2 text-center">{Math.round(result.WaermeQuellenAnlagentechnikTrinkwarmwasser.Dezember)}</td>
        </tr>
        
        <!-- Summenzeile -->
      </tbody>
    </table>
  </div>