- Bar Chart - Interactive
+ Data Increase
- Showing total visitors for the last 3 months
+ Showing total data for the last 3 months
- {["desktop", "mobile"].map((key) => {
+ {["users", "records", "urls"].map((key) => {
const chart = key as keyof typeof chartConfig;
return (
);
@@ -174,7 +91,7 @@ export function InteractiveBarChart() {
>
@@ -33,8 +33,7 @@ export async function DashboardInfoCard({
{title}
- {/* {icon && } */}
-
+
{[-1, undefined].includes(count) ? (
diff --git a/components/layout/dashboard-sidebar.tsx b/components/layout/dashboard-sidebar.tsx
index 0953cdd..5df8889 100644
--- a/components/layout/dashboard-sidebar.tsx
+++ b/components/layout/dashboard-sidebar.tsx
@@ -29,25 +29,6 @@ interface DashboardSidebarProps {
export function DashboardSidebar({ links }: DashboardSidebarProps) {
const path = usePathname();
- // NOTE: Use this if you want save in local storage -- Credits: Hosna Qasmei
- //
- // const [isSidebarExpanded, setIsSidebarExpanded] = useState(() => {
- // if (typeof window !== "undefined") {
- // const saved = window.localStorage.getItem("sidebarExpanded");
- // return saved !== null ? JSON.parse(saved) : true;
- // }
- // return true;
- // });
-
- // useEffect(() => {
- // if (typeof window !== "undefined") {
- // window.localStorage.setItem(
- // "sidebarExpanded",
- // JSON.stringify(isSidebarExpanded),
- // );
- // }
- // }, [isSidebarExpanded]);
-
const { isTablet } = useMediaQuery();
const [isSidebarExpanded, setIsSidebarExpanded] = useState(!isTablet);
diff --git a/components/shared/icons.tsx b/components/shared/icons.tsx
index 5996a4e..5996f1d 100644
--- a/components/shared/icons.tsx
+++ b/components/shared/icons.tsx
@@ -32,6 +32,7 @@ import {
SunMedium,
Trash2,
User,
+ Users,
X,
} from "lucide-react";
@@ -119,6 +120,7 @@ export const Icons = {
),
user: User,
+ users: Users,
warning: AlertTriangle,
globeLock: GlobeLock,
link: Link,
diff --git a/config/dashboard.ts b/config/dashboard.ts
index 7aa582b..1dfd40b 100644
--- a/config/dashboard.ts
+++ b/config/dashboard.ts
@@ -24,20 +24,20 @@ export const sidebarLinks: SidebarNavItem[] = [
},
{
href: "/admin/users",
- icon: "user",
- title: "Users",
+ icon: "users",
+ title: "User List",
authorizeOnly: UserRole.ADMIN,
},
{
href: "/admin/records",
icon: "lineChart",
- title: "Records",
+ title: "Record List",
authorizeOnly: UserRole.ADMIN,
},
{
href: "/admin/urls",
icon: "post",
- title: "URLs",
+ title: "URL List",
authorizeOnly: UserRole.ADMIN,
},
],
diff --git a/lib/utils.ts b/lib/utils.ts
index 7f315f3..0bf8a58 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -100,7 +100,7 @@ export const expirationTime = (
const remainingTime = expirationTime - now;
if (remainingTime <= 0) return "Expired";
- const remainingTimeString = ms(remainingTime, { long: false });
+ const remainingTimeString = ms(remainingTime, { long: true });
if (timeOnly) {
return remainingTimeString;
}