From e8fa9bd7bba125a339f11876eb5ea99d0cd301b6 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 25 May 2023 19:11:31 -0600 Subject: Añade historial de órdenes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/order_table.tsx | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/components/order_table.tsx (limited to 'src/components/order_table.tsx') diff --git a/src/components/order_table.tsx b/src/components/order_table.tsx new file mode 100644 index 0000000..207b3e4 --- /dev/null +++ b/src/components/order_table.tsx @@ -0,0 +1,56 @@ +import Order from "../models/order"; +import "./stylesheets/shared.css"; + +function getRows(orders: Array) { + const rows = orders.map(order => ( + + + {order.id} + + + {order.public_id} + + + {order.created_at.toLocaleString().split('T')[0]} + + + {order.total} + + + )); + + return rows; +} + +export default function OrderTable({ orders }) { + const rows = getRows(orders); + + return( +
+

+ Historial de órdenes +

+ + + + + + + + + + + {rows} + +
+ Número de orden + + Identificador + + Fecha + + Total +
+
+ ); +} \ No newline at end of file -- cgit v1.2.3