SavedFuture.tsx (797B)
1 import React from "react"; 2 3 import ShowFuture from "./ShowFuture"; 4 5 import { getSavedZones } from "../../utils"; 6 7 function SavedFuture({ 8 selectedTime, 9 }: { 10 selectedTime: moment.Moment | undefined; 11 }): JSX.Element { 12 const list = getSavedZones(); 13 return ( 14 <div className="mt-5"> 15 {selectedTime && list.length > 0 ? ( 16 <ShowFuture selectedTime={selectedTime} zones={list} /> 17 ) : ( 18 <h5 19 className="border-top mt-5 text-center" 20 style={{ paddingTop: "1rem" }} 21 > 22 You haven't {selectedTime ? "saved any timezones" : "selected a time"}{" "} 23 so far.{" "} 24 <span aria-label="Saved list is empty." role="img"> 25 😅 26 </span> 27 </h5> 28 )} 29 </div> 30 ); 31 } 32 33 export default SavedFuture;