diff --git a/src/components/SearchResults/SearchResults.jsx b/src/components/SearchResults/SearchResults.jsx
index 330e68b..523dee6 100644
--- a/src/components/SearchResults/SearchResults.jsx
+++ b/src/components/SearchResults/SearchResults.jsx
@@ -1,9 +1,10 @@
// SearchResults.jsx
-import React from 'react';
-import TableHead from './TableHead';
-import TableBody from './TableBody';
+import React from "react";
+import TableHead from "./TableHead";
+import TableBody from "./TableBody";
+import dayjs from "dayjs";
-const SearchResults = ({results}) => {
+const SearchResults = ({ results }) => {
return (
@@ -17,13 +18,16 @@ const SearchResults = ({results}) => {
title={booking.title}
firstName={booking.firstName}
surName={booking.surname}
+ nights={dayjs(booking.checkOutDate)
+ .diff(dayjs(booking.checkInDate), "days")
+ .toString()
+ .padStart(2, "0")}
email={booking.email}
/>
))}
);
-}
+};
export default SearchResults;
-
diff --git a/src/components/SearchResults/TableBody.jsx b/src/components/SearchResults/TableBody.jsx
index 515f587..84d71ae 100644
--- a/src/components/SearchResults/TableBody.jsx
+++ b/src/components/SearchResults/TableBody.jsx
@@ -1,15 +1,16 @@
-import React from 'react';
+import React from "react";
-const TableBody = ({ id, title, firstName, surName, email }) => {
+const TableBody = ({ id, title, firstName, surName, email, nights }) => {
return (
{id} |
{title} |
{firstName} |
{surName} |
+ {nights} |
{email} |
);
-}
+};
export default TableBody;
diff --git a/src/components/SearchResults/TableHead.jsx b/src/components/SearchResults/TableHead.jsx
index f7d7f59..6390fec 100644
--- a/src/components/SearchResults/TableHead.jsx
+++ b/src/components/SearchResults/TableHead.jsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React from "react";
const TableHead = () => {
return (
@@ -7,9 +7,10 @@ const TableHead = () => {
Title |
First Name |
Last Name |
+ Nights |
Email |
);
-}
+};
-export default TableHead;
\ No newline at end of file
+export default TableHead;