diff --git a/src/Pages/Dashboard/AgencyName.tsx b/src/Pages/Dashboard/AgencyName.tsx new file mode 100644 index 0000000..9941623 --- /dev/null +++ b/src/Pages/Dashboard/AgencyName.tsx @@ -0,0 +1,103 @@ +import { Box, HStack, Image, Input, Stack, Text } from "@chakra-ui/react"; +import React, { useState, useEffect } from "react"; +import { Button } from "../../components/ui/button"; +import { IoAddSharp } from "react-icons/io5"; +import delateIcon from "../../assets/deleteIcon.png"; +import { FaClockRotateLeft } from "react-icons/fa6"; + +interface Todo { + id: number; + text: string; + completed: boolean; + timestamp: string; +} + +const AgencyName: React.FC = () => { + const [todos, setTodos] = useState([]); + const [input, setInput] = useState(""); + + + const getCurrentTime = () => { + const now = new Date(); + return now.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); + }; + + + const addTodo = () => { + if (input.trim() === "") return; + setTodos([...todos, { id: Date.now(), text: input, completed: false, timestamp: getCurrentTime() }]); + setInput(""); + }; + + // Delete a task + const deleteTodo = (id: number) => { + setTodos(todos.filter((todo) => todo.id !== id)); + }; + + useEffect(() => { + const savedTodos = localStorage.getItem("todos"); + if (savedTodos) { + setTodos(JSON.parse(savedTodos)); + } + }, []); // Runs only on mount + + // 🔹 Save todos to localStorage whenever they change + useEffect(() => { + if (todos.length > 0) { + localStorage.setItem("todos", JSON.stringify(todos)); + } + }, [todos]); // Runs when `todos` changes + + + return ( + + + + Add Agency Name + + + + setInput(e.target.value)} + placeholder="Add a task..." + backgroundColor={"#fff"} + size={"sm"} + w={"100%"} + p={2} + mb={4} + /> + {todos.map((todo) => ( + + {todo.text} + + + + {todo.timestamp} + + deleteTodo(todo.id)} + bg={"none"} + color={"#22222299"} + cursor={'pointer'} + > + + + + + ))} + + ); +}; + +export default AgencyName; diff --git a/src/Pages/Dashboard/Dashboard.tsx b/src/Pages/Dashboard/Dashboard.tsx index 5a0e63e..e60e41c 100644 --- a/src/Pages/Dashboard/Dashboard.tsx +++ b/src/Pages/Dashboard/Dashboard.tsx @@ -19,17 +19,55 @@ import { SelectValueText, } from "../../components/ui/select"; import SemiDoughnutChart from "../../components/Charts/SemiDoughnutChart"; +import { Button } from "../../components/ui/button"; +import { + AccordionItem, + AccordionItemContent, + AccordionItemTrigger, + AccordionRoot, +} from "../../components/ui/accordion"; +import AgencyName from "./AgencyName"; +import CircularProgress from "../../components/Charts/CircularProgress"; +import CircularApp from "../../components/Charts/CircularProgress"; const Dashboard = () => { const frameworks = createListCollection({ items: [ - { label: "React.js", value: "react" }, - { label: "Vue.js", value: "vue" }, - { label: "Angular", value: "angular" }, - { label: "Svelte", value: "svelte" }, + { label: "Today", value: "Today" }, + { label: "Week", value: "Week" }, + { label: "Month", value: "Month" }, + { label: "Year", value: "Year" }, ], }); + const accItems = [ + { + value: "1", + title: "How to create new account?", + text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", + }, + { + value: "2", + title: "How to create new account?", + text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", + }, + { + value: "3", + title: "How to create new account?", + text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", + }, + { + value: "4", + title: "How to create new account?", + text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", + }, + { + value: "5", + title: "How to create new account?", + text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum has been the industry's standard dummy text ever since.", + }, + ]; + return ( @@ -47,16 +85,28 @@ const Dashboard = () => { mb={6} > - Tab 1 - Tab 2 - Tab 3 + + Past 24 hrs + + + Total Users + + + New Signups + - + Recruiter 2554 @@ -92,11 +142,50 @@ const Dashboard = () => { + p={'10px'} + > + Number Of Groups created + + - - + + + Faqs + + + + {accItems.map((item, index) => ( + + + {item.title} + + + {item.text} + + + ))} + + + + + ); diff --git a/src/components/Charts/CircularProgress.tsx b/src/components/Charts/CircularProgress.tsx new file mode 100644 index 0000000..95fb47c --- /dev/null +++ b/src/components/Charts/CircularProgress.tsx @@ -0,0 +1,51 @@ +import { Box, Text } from "@chakra-ui/react"; +import React, { useEffect, useState } from "react"; + +const CircularProgress: React.FC<{ value: number; max: number }> = ({ value, max }) => { + const totalDots = 60; // Total number of dots in the circle + const filledDots = Math.round((value / max) * totalDots); // Number of filled dots + + return ( + + + {Array.from({ length: totalDots }).map((_, i) => { + const angle = (i / totalDots) * 360; + const x = 50 + 40 * Math.cos((angle * Math.PI) / 180); + const y = 50 + 40 * Math.sin((angle * Math.PI) / 180); + + return ( + + ); + })} + + {value} + + ); +}; + +// Usage Example with Animation +const CircularApp: React.FC = () => { + const [progress, setProgress] = useState(0); + + useEffect(() => { + const interval = setInterval(() => { + setProgress((prev) => (prev < 350 ? prev + 20 : 350)); + }, 300); + return () => clearInterval(interval); + }, []); + + return ( + + + + ); +}; + +export default CircularApp;