diff --git a/frontend/src/components/pages/AdminControls/SignInLogs.tsx b/frontend/src/components/pages/AdminControls/SignInLogs.tsx index b52219b1..70d876da 100644 --- a/frontend/src/components/pages/AdminControls/SignInLogs.tsx +++ b/frontend/src/components/pages/AdminControls/SignInLogs.tsx @@ -1,14 +1,11 @@ -import React, { useEffect, useRef, useState } from "react"; +import React, { useRef, useState } from "react"; import { Box, Flex } from "@chakra-ui/react"; - -import { PassThrough } from "stream"; import Pagination from "../../common/Pagination"; import NavigationBar from "../../common/NavigationBar"; import { User } from "../../../types/UserTypes"; import SignInLogsTable from "./SignInLogsTable"; import UserAPIClient from "../../../APIClients/UserAPIClient"; - - +import { SignInLog } from "../../../types/SignInLogsTypes"; const SignInLogsPage = (): React.ReactElement => { const [users, setUsers] = useState<User[]>([]); @@ -37,19 +34,13 @@ const SignInLogsPage = (): React.ReactElement => { } }; - // Dummy data - type MyDictionary = { - [key: string]: any; - }; - // Create an array of dictionaries - const signInLogs: MyDictionary[] = [ + const signInLogs: SignInLog[] = [ { id: 1, date: "2023-12-03T13:30:00.000Z" , name: "Aathithan Chandrabalan" }, { id: 1, date: "2023-12-01T12:30:00.000Z" , name: "Phil Dunphy" }, { id: 1, date: "2023-12-04T15:11:00.000Z" , name: "Connor Bechthold" }, { id: 1, date: "2023-12-05T19:45:00.000Z" , name: "Bob Cob" }, { id: 1, date: "2023-12-05T21:23:00.000Z" , name: "Jessica P" }, - ]; return ( diff --git a/frontend/src/components/pages/AdminControls/SignInLogsTable.tsx b/frontend/src/components/pages/AdminControls/SignInLogsTable.tsx index 6742f0f8..c1690af3 100644 --- a/frontend/src/components/pages/AdminControls/SignInLogsTable.tsx +++ b/frontend/src/components/pages/AdminControls/SignInLogsTable.tsx @@ -9,12 +9,11 @@ import { Thead, Tr, } from "@chakra-ui/react"; -import { User } from "../../../types/UserTypes"; // Needs to be changed !! - import getFormattedDateAndTime from "../../../utils/DateUtils"; +import { SignInLog } from "../../../types/SignInLogsTypes"; type Props = { - signInLogs: { id: number; date: string; name: string }[]; + signInLogs: SignInLog[]; tableRef: RefObject<HTMLDivElement>; }; @@ -46,7 +45,6 @@ const SignInLogsTable = ({ const { date, time } = getFormattedDateAndTime(dateObj); return ( - <Tr key={log.id} style={{ verticalAlign: "middle" }}> <Td width="33%">{`${log.name}`}</Td> <Td width="33%">{date}</Td> @@ -54,10 +52,7 @@ const SignInLogsTable = ({ </Tr> ); })} - </Tbody> - - </Table> </TableContainer> </Box> diff --git a/frontend/src/types/SignInLogsTypes.ts b/frontend/src/types/SignInLogsTypes.ts new file mode 100644 index 00000000..5019957c --- /dev/null +++ b/frontend/src/types/SignInLogsTypes.ts @@ -0,0 +1,5 @@ +export type SignInLog = { + id: number, + name: string, + date: string +} \ No newline at end of file