From a65d6d9127c3fa7f6a8ecaec5d1ffd1f47c2bc98 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:08:53 +0300 Subject: refactor: port to typescript --- frontend/src/components/record.js | 56 --------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 frontend/src/components/record.js (limited to 'frontend/src/components/record.js') diff --git a/frontend/src/components/record.js b/frontend/src/components/record.js deleted file mode 100644 index 80e084d..0000000 --- a/frontend/src/components/record.js +++ /dev/null @@ -1,56 +0,0 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { useLocation, Link } from "react-router-dom"; - -import "./record.css" - -export default function Record({ name, place, portals, time, date }) { - // const {token} = prop; - const [record, setRecord] = useState(null); - const location = useLocation(); - - // useEffect(() => { - // console.log(name, place, portals, time, date); - // }) - - function timeSince() { - const now = new Date(); - const dateNew = new Date(date); - - const secondsPast = Math.floor((now - dateNew) / 1000); - - if (secondsPast < 60) { - return `${secondsPast} seconds ago`; - } - if (secondsPast < 3600) { - const minutes = Math.floor(secondsPast / 60); - return `${minutes} minutes ago`; - } - if (secondsPast < 86400) { - const hours = Math.floor(secondsPast / 3600); - return `${hours} hours ago`; - } - if (secondsPast < 2592000) { - const days = Math.floor(secondsPast / 86400); - return `${days} days ago`; - } - if (secondsPast < 31536000) { - const months = Math.floor(secondsPast / 2592000); - return `${months} months ago`; - } - const years = Math.floor(secondsPast / 31536000); - return `${years} years ago`; - } - - return( -