From a86f0a804bf8d1ff37d9027930aad1fdcbde3ad6 Mon Sep 17 00:00:00 2001
From: Tom van der Lee <tom@vanderlee.io>
Date: Wed, 16 Feb 2022 21:10:39 +0100
Subject: Added a timestamp

---
 src/components/RequestSummary/RequestSummary.tsx | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'src/components/RequestSummary/RequestSummary.tsx')

diff --git a/src/components/RequestSummary/RequestSummary.tsx b/src/components/RequestSummary/RequestSummary.tsx
index 44254d0..49e6086 100644
--- a/src/components/RequestSummary/RequestSummary.tsx
+++ b/src/components/RequestSummary/RequestSummary.tsx
@@ -3,10 +3,12 @@ import * as React from "react";
 import classNames from "classnames";
 
 import { Badge, Col, Row } from "react-bootstrap";
+import dayjs from "dayjs";
 
 interface RequestSummaryProps {
   selected?: boolean;
   requestResponse: RequestResponse;
+  showTime?: boolean;
 }
 
 function isBetween(value: number, min: number, max: number) {
@@ -32,9 +34,22 @@ function calcBadgeVariant(statusCode: number | undefined): string {
 export default function RequestSummary({
   requestResponse: { request, response },
   selected = false,
+  showTime = false,
 }: RequestSummaryProps) {
   return (
     <Row>
+      {showTime && (
+        <Col
+          className={classNames(
+            "flex-grow-0 d-flex align-items-center text-nowrap",
+            {
+              "text-muted": !selected,
+            }
+          )}
+        >
+          {dayjs(request.timestamp).format("LTS")}
+        </Col>
+      )}
       <Col className="flex-grow-0 d-flex align-items-center">
         {request.method}
       </Col>
-- 
cgit v1.2.3

