-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c2e100
commit 14fac45
Showing
21 changed files
with
1,326 additions
and
8 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use client"; | ||
import { AnalyticsContainer } from "@/containers"; | ||
|
||
export default function Analytics() { | ||
return ( | ||
<div> | ||
<AnalyticsContainer /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { PropsWithChildren } from "react"; | ||
|
||
type PropsType = { | ||
header?: React.ReactNode; | ||
}; | ||
|
||
/** This component renders a card*/ | ||
export const Card: React.FC<PropsWithChildren<PropsType>> = ({ | ||
children, | ||
header, | ||
}) => { | ||
return ( | ||
<div className="min-w-[200px] inline-block border-solid border border-gray-200 rounded-md shadow-md"> | ||
<div className="p-4 border-0 border-solid border-b border-gray-200 font-bold"> | ||
{header && <>{header}</>} | ||
</div> | ||
<div className="p-4">{children}</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { VideoRecordingScreen } from "./video-recording-screen/video-recording-screen"; | ||
export { Table } from "./table/table"; | ||
export { Button } from "./button/button"; | ||
export { Card } from "./card/card"; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
Frontend/src/containers/analytics-container/analytics-container.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use client"; | ||
import type { FC } from "react"; | ||
import React from "react"; | ||
import { AuthorizedCounterContainer } from "./authorized-counter/authorized-counter"; | ||
import { UnauthorizedCounterContainer } from "./unauthorized-counter/unauthorized-counter"; | ||
import { AuthorizedUnauthorizedPieContainer } from "./authorized-unauthorized-pie/authorized-unauthorized-pie"; | ||
import { AuthorizedUnauthorizedLineContainer } from "./authorized-unauthorized-line/authorized-unauthorized-line"; | ||
import { UserAreaBarContainer } from "./user-area-bar/user-area-bar"; | ||
import { RecentAuthorizedContainer } from "./recent-authorized/recent-authorized"; | ||
import { RecentUnauthorizedContainer } from "./recent-unauthorized/recent-unauthorized"; | ||
|
||
/* This container renders analytics sections */ | ||
export const AnalyticsContainer: FC = () => { | ||
return ( | ||
<div> | ||
<div className="grid gap-4 grid-cols-3"> | ||
<UnauthorizedCounterContainer /> | ||
|
||
<AuthorizedCounterContainer /> | ||
|
||
<AuthorizedUnauthorizedPieContainer /> | ||
</div> | ||
|
||
<div className="grid pt-4 grid-cols-1"> | ||
<AuthorizedUnauthorizedLineContainer /> | ||
</div> | ||
<div className="grid pt-4 grid-cols-1"> | ||
<UserAreaBarContainer /> | ||
</div> | ||
|
||
<div className="grid py-4 gap-4 grid-cols-2"> | ||
<RecentAuthorizedContainer /> | ||
|
||
<RecentUnauthorizedContainer /> | ||
</div> | ||
</div> | ||
); | ||
}; |
60 changes: 60 additions & 0 deletions
60
Frontend/src/containers/analytics-container/authorized-counter/authorized-counter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, { useState } from "react"; | ||
import type { FC } from "react"; | ||
import { SecurityScanOutlined } from "@ant-design/icons"; | ||
import { Statistic, Select, DatePicker } from "antd"; | ||
import { Card } from "@/components"; | ||
import dayjs from "dayjs"; | ||
import type { Dayjs } from "dayjs"; | ||
import { theme } from "../../../../theme"; | ||
|
||
export const AuthorizedCounterContainer: FC = () => { | ||
const [timeOption, setTimeOption] = useState<"day" | "month">("day"); | ||
const [date, setDate] = useState<Dayjs>(dayjs()); | ||
|
||
const CardHeader: FC = () => { | ||
return ( | ||
<div className="text-sm flex gap-x-4 justify-between items-center"> | ||
<span>Authorized access</span> | ||
<Select | ||
popupMatchSelectWidth={false} | ||
size="small" | ||
defaultValue={timeOption} | ||
onChange={setTimeOption} | ||
options={[ | ||
{ value: "day", label: "Day" }, | ||
{ value: "month", label: "Month" }, | ||
]} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Card header={<CardHeader />}> | ||
<Statistic | ||
className="text-success py-4" | ||
value={458} | ||
valueStyle={{ | ||
color: theme.colors.successColor, | ||
fontSize: "2rem", | ||
textAlign: "center", | ||
}} | ||
prefix={<SecurityScanOutlined />} | ||
/> | ||
<div className={"flex flex-col gap-2 justify-center items-center"}> | ||
<span>No of attempts on:</span> | ||
<div> | ||
<DatePicker | ||
format={timeOption === "month" ? "MMM-YYYY" : "DD-MMM-YYYY"} | ||
onChange={setDate} | ||
defaultValue={date} | ||
allowClear={false} | ||
picker={timeOption === "month" ? timeOption : undefined} | ||
/> | ||
</div> | ||
</div> | ||
</Card> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.