/** HeatPumpTable — shows available/excluded heat pumps with comparison data. */ import { useState } from 'react'; import { useAnalysisStore } from '../../store/analysisStore'; export default function HeatPumpTable() { const hpiResult = useAnalysisStore((s) => s.hpiResult); const [isExcludedOpen, setIsExcludedOpen] = useState(false); if (!hpiResult) return null; const available = hpiResult.heat_pumps.filter((hp) => hp.available); const excluded = hpiResult.excluded_heat_pumps; if (available.length === 0 && excluded.length === 0) return null; return (
Integrable heat pumps
| Heat Pump | COP | T_source (°C) | T_sink (°C) | Q_source (kW) | Q_sink (kW) |
|---|---|---|---|---|---|
| {hp.name} | {hp.cop?.toFixed(2) ?? '—'} | {hp.t_source?.toFixed(1) ?? '—'} | {hp.t_sink?.toFixed(1) ?? '—'} | {hp.q_source?.toFixed(1) ?? '—'} | {hp.q_sink?.toFixed(1) ?? '—'} |
setIsExcludedOpen(!isExcludedOpen)} style={{ cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }} > Heat pumps that cannot be integrated ▼
{isExcludedOpen && (