From 38e86dac4bb7c756c661451344d12a615a71f614 Mon Sep 17 00:00:00 2001 From: Nabil Mohammed Date: Thu, 14 Dec 2023 22:55:58 +0100 Subject: [PATCH] recent activities page UI complete --- Frontend/src/app/recent-activities/page.tsx | 15 +++++ Frontend/src/data/camera-data.tsx | 40 ++++++++++++ Frontend/src/data/index.ts | 5 ++ Frontend/src/data/recent-activities-data.tsx | 69 ++++++++++++++++++++ Frontend/src/store/slices/camera-slice.ts | 40 +----------- Frontend/src/types/index.ts | 1 + Frontend/src/types/models/activity.ts | 12 ++++ Frontend/tailwind.config.ts | 5 +- Frontend/theme.ts | 1 + 9 files changed, 149 insertions(+), 39 deletions(-) create mode 100644 Frontend/src/app/recent-activities/page.tsx create mode 100644 Frontend/src/data/camera-data.tsx create mode 100644 Frontend/src/data/recent-activities-data.tsx create mode 100644 Frontend/src/types/models/activity.ts diff --git a/Frontend/src/app/recent-activities/page.tsx b/Frontend/src/app/recent-activities/page.tsx new file mode 100644 index 0000000..680a8be --- /dev/null +++ b/Frontend/src/app/recent-activities/page.tsx @@ -0,0 +1,15 @@ +"use client"; +import { Table } from "@/components"; +import { recentActivitiesData, recentActivitiesColumns } from "@/data"; + +export default function RecentActivities() { + return ( +
+ + + ); +} diff --git a/Frontend/src/data/camera-data.tsx b/Frontend/src/data/camera-data.tsx new file mode 100644 index 0000000..02eaeac --- /dev/null +++ b/Frontend/src/data/camera-data.tsx @@ -0,0 +1,40 @@ +import { Camera } from "@/types"; + +export const cameras: Camera[] = [ + { + key: "backyard", + name: "Backyard", + isActive: true, + url: "https://www.youtube.com/embed/Sv2h-csnlps?modestbranding=1&showinfo=0&controls=0&autoplay=1&mute=1", + }, + { + key: "main-road", + name: "Main road", + isActive: true, + url: "https://www.youtube.com/embed/yNQmth5kUZ0?modestbranding=1&showinfo=0&controls=0&autoplay=1&mute=1", + }, + { + key: "door", + name: "Door", + isActive: true, + url: "https://www.youtube.com/embed/dV9ngLCKE7k?modestbranding=1&showinfo=0&controls=0&autoplay=1&mute=1", + }, + { + key: "pet-room", + name: "Pet room", + isActive: true, + url: "https://www.youtube.com/embed/ewEW_xAKRMg?modestbranding=1&showinfo=0&controls=0&autoplay=1&mute=1", + }, + { + key: "basement", + name: "Basement", + isActive: false, + url: "https://www.youtube.com/embed/ewEW_xAKRMg?modestbranding=1&showinfo=0&controls=0&autoplay=1&mute=1", + }, + { + key: "baby-room", + name: "Baby room", + isActive: false, + url: "https://www.youtube.com/embed/ewEW_xAKRMg?modestbranding=1&showinfo=0&controls=0&autoplay=1&mute=1", + }, +]; diff --git a/Frontend/src/data/index.ts b/Frontend/src/data/index.ts index 4bfa3b5..c5960e9 100644 --- a/Frontend/src/data/index.ts +++ b/Frontend/src/data/index.ts @@ -5,3 +5,8 @@ export { } from "./authorized-entities-data"; export { contactUsData } from "./contact-us-data"; export { aboutUsData } from "./about-us-data"; +export { cameras } from "./camera-data"; +export { + recentActivitiesData, + recentActivitiesColumns, +} from "./recent-activities-data"; diff --git a/Frontend/src/data/recent-activities-data.tsx b/Frontend/src/data/recent-activities-data.tsx new file mode 100644 index 0000000..8dca1e4 --- /dev/null +++ b/Frontend/src/data/recent-activities-data.tsx @@ -0,0 +1,69 @@ +"use client"; +import { Activity } from "@/types"; +import { Button } from "@/components"; +import { Space } from "antd"; +import { CameraOutlined, VideoCameraOutlined } from "@ant-design/icons"; +import type { ColumnsType } from "antd/es/table"; +import { cameras } from "./camera-data"; +import { authorizedEntitiesData } from "./authorized-entities-data"; + +export const recentActivitiesColumns: ColumnsType = [ + { + title: "Time", + dataIndex: "timestamp", + key: "timestamp", + }, + { + title: "Camera", + dataIndex: "camera", + render: (_, record) => {record.camera.name}, + }, + { + title: "Entity", + dataIndex: "entity", + render: (_, record) => ( + + {record.entity ? record.entity.name : "Unkown"} + + ), + }, + { + title: "Action", + key: "action", + render: (_, record) => ( + +