diff --git a/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistory.tsx b/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistory.tsx index 774288e9..d0809501 100644 --- a/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistory.tsx +++ b/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistory.tsx @@ -1,3 +1,5 @@ +import { EnergyUseHistoryChart } from './EnergyUseHistoryChart.tsx' + export function EnergyUseHistory() { const averageIndoorTemperature = '63.5' const dailyOtherUsage = '1.07' @@ -44,7 +46,7 @@ export function EnergyUseHistory() {
Usage Details
-
(insert chart here)
+ ) } diff --git a/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistoryChart.tsx b/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistoryChart.tsx new file mode 100644 index 00000000..0fb52d47 --- /dev/null +++ b/heat-stack/app/components/ui/CaseSummaryComponents/EnergyUseHistoryChart.tsx @@ -0,0 +1,58 @@ +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '../../../components/ui/table.tsx' + +const months = [ + { + includeData: true, + startDate: '02/02/2018', + endDate: '02/28/2018', + daysInBill: '27', + usage: 'Yes', + fUA: '10', + }, + { + includeData: true, + startDate: '03/01/2018', + endDate: '03/31/2018', + daysInBill: '31', + usage: 'Modest', + fUA: '30', + }, +] + +export function EnergyUseHistoryChart() { + return ( + + + + # + Include Data + Start Date + End Date + Days in Bill + Usage (therms) + 60.5 °F UA (BTU/h-F) + + + + {months.map((month, index) => ( + + {index + 1} + {month.includeData} + {month.startDate} + {month.endDate} + {month.daysInBill} + {month.usage} + {month.fUA} + + ))} + +
+ ) +} diff --git a/heat-stack/app/components/ui/table.tsx b/heat-stack/app/components/ui/table.tsx new file mode 100644 index 00000000..ba987225 --- /dev/null +++ b/heat-stack/app/components/ui/table.tsx @@ -0,0 +1,117 @@ +import * as React from "react" + +import { cn } from "#app/utils/misc.tsx" + +const Table = React.forwardRef< + HTMLTableElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+ + +)) +Table.displayName = "Table" + +const TableHeader = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableHeader.displayName = "TableHeader" + +const TableBody = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableBody.displayName = "TableBody" + +const TableFooter = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + tr]:last:border-b-0", + className + )} + {...props} + /> +)) +TableFooter.displayName = "TableFooter" + +const TableRow = React.forwardRef< + HTMLTableRowElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableRow.displayName = "TableRow" + +const TableHead = React.forwardRef< + HTMLTableCellElement, + React.ThHTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +TableHead.displayName = "TableHead" + +const TableCell = React.forwardRef< + HTMLTableCellElement, + React.TdHTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableCell.displayName = "TableCell" + +const TableCaption = React.forwardRef< + HTMLTableCaptionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +TableCaption.displayName = "TableCaption" + +export { + Table, + TableHeader, + TableBody, + TableFooter, + TableHead, + TableRow, + TableCell, + TableCaption, +}